background preloader

Windows

Facebook Twitter

Window Features (Windows) - Iceweasel. This overview discusses features of windows such as window types, states, size, and position. Window Types This section contains the following topics that describe window types. Overlapped Windows An overlapped window is a top-level window that has a title bar, border, and client area; it is meant to serve as an application's main window. Pop-up Windows Child Windows A child window has a client area but no other features, unless they are explicitly requested. This section discusses the following: Positioning The system always positions a child window relative to the upper left corner of its parent window's client area. Clipping Relationship to Parent Window The parent window relinquishes a portion of its client area to a child window, and the child window receives all input from this area. Messages Layered Windows Using a layered window can significantly improve performance and visual effects for a window that has a complex shape, animates its shape, or wishes to use alpha blending effects.

Win32 Performance Measurement Options | Dr Dobb's Journal - Iceweasel. Win32 Debug CRT Heap Internals - Iceweasel. … by Andrew Birkett (andy@nobugs.org) If you are lazy, skip the explanation and jump to the table at the bottom of the page When you compile programs with DevStudio in debug mode, all of your calls to malloc() and free() use a special “debug” implementation. Rather than being blazingly fast, the debug heap concerns itself with spotting heap errors. It achieves this by surrounding your memory blocks with guard bytes (aka “no mans land”, 0xFD) so that it can detect buffer overruns and underruns. It also initialises newly allocated memory to a fixed value (0xCD) to aid reproducability.

Mnemonics for remembering what each fill-pattern means: The newly allocated memory (0xCD) is Clean memory. The debug CRT heap defers most of the heavy work to the Win32 heap functions HeapAlloc() and HeapFree(). If you call malloc(8), the debug CRT will request a 48 byte block from HeapAlloc(). HeapAlloc() itself needs bookkeeping information. At this point, two things can happen. Any comments or feedback? TheForger's Win32 API Tutorial - Iceweasel. Welcome to theForger's Win32 API Tutorial This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as possible. Download Full Example Code The tutorial text does not include full source code listings, you will need to download this .zip if you want to compile the completed examples. This tutorial is meant to be read as a whole Please read it from beginning to end before asking questions... most of them will probably be answered.

Each section builds on the sections before it. I have also added some solutions to common errors in Appendix A. If you are viewing this locally or on another website, visit the #winprog website for the current official copy. The translation and PDF versions are unfortunately difficult to update, and are based on older versions of the tutorial. Visual Styles Reference (Windows) - Iceweasel. Use Our ManWrap Library to Use .NET in Native C++ Code - Iceweasel.

Good hygiene and Banned APIs - The Security Development Lifecycle - Site Home - MSDN Blogs - Iceweasel. Jeremy Dallman here with a quick note about a code sanitizing tool we are making available to support one of the SDL requirements – Remove all Banned APIs from your code. This requirement was put in place to prevent use of certain older C runtime functions that lead to buffer overrun flaws and have been deprecated. In the Security Development Lifecycle book, an entire chapter is dedicated to the topic of banned function calls. In the book, we also provide a copy of the banned.h header file on the companion CD. This header file allows you to locate any banned functions in your code. On MSDN, we have document the SDL list of Banned Function Calls, but the header file has not been publicly available outside the SDL book until now. Find the banned.h header here By including this header file, then using #include “banned.h”; you will be able to locate any banned functions in your code.

Sanitizing your code to remove potentially insecure APIs is a vital protection. Set up your system to use Microsoft's public Symbol Server - Scott Hanselman - Iceweasel. Microsoft Visual C++ Tips and Tricks - Iceweasel. By Alan De Smet If you're stuck using Microsoft Visual C++, these tips may help make the experience more pleasant. I've been collecting these little tidbits for a while, and decided to collect them in one spot. I've chosen to collect them here because I can't think of a better spot. First thing, get yourself a copy of Workspace Whiz. Workspace Whiz gives you a nice GUI interface to Exhuberant CTAGS. It also gives you a handy button to switch between the header and source files. Next, get yourself a copy of STLFilt. Whenever I refer to the "sharedide" directory, you'll need to change it to the appropriate directory. Show compile duration Simply add '/Y3' to the command line of VC (In the short cut).

Update 2003-01-10: I haven't had a chance to use Visual Studio .NET yet, but I'm told that you can set this option with a switch under Options > Projects > Build. Teach VC to intelligently expand classes/structs in debugger Add user defined keywords for syntax highlighting Custom Tip of the Day. HTML Help Downloads - Iceweasel. All HTML Help downloads are now available from the Microsoft.com Download Center. Note The latest version of the HTML Help technology is 1.4, as is the SDK. The latest version of HTML Help Workshop is 1.3. As of June 2009 there is no HTML Help Workshop 1.4. HTML Help Workshop Download Htmlhelp.exe A Japanese version of HTML Help Workshop is also available: Download Htmlhelpj.exe HTML Help documentation Download HelpDocs.zip The documentation includes the following files. End-User License Agreement System Requirements You must set up Microsoft Internet Explorer (3.0 or later) on your computer before using HTML Help.

HTML Help requires about 8 MB of free disk space. Notes Important Close any open instances of HTML Help Workshop before reinstalling or updating to a new version. To install, right-click the link to the desired file, select "Save Target As", and choose a location on your local computer. Windows XP, 2000, ME, and 98 users should not run Hhupd.exe. John Robbins' Blog : PDB Files: What Every Developer Must Know - Iceweasel. Thanks for visiting one of the most popular pieces I’ve ever written! Based on questions I’ve written a few follow up articles you might find useful to extend your PDB knowledge after reading this one. Keeping Specific PDB Files from Loading in the Debugger Do PDB Files Affect Performance?

Correctly Creating Native C++ Release Build PDBs How Many Secrets do .NET PDB Files Really Contain? If you’d love to know more about debugging, check out my Mastering .NET Debugging or Mastering Windows Debugging (for native C++) courses over at our great on-demand learning site WintellectNOW. Because you’re obviously a great developer for reading this, use the code JOHNR-2013 and get your first two weeks free! Are you more interested in instructor lead training? If you have any questions about PDB files ask a question in the comments, email me (john AT wintellect DOT com) or ask me on Twitter @JohnWintellect. Before we jump in, I need to define two important terms. Introduction to the Windows Threadpool (Part 1) - Hari's Blog - Site Home - MSDN Blogs - Iceweasel. Download source code from MSDN Code Gallery. I regularly receive feedback that the Win32 Threadpool API is complex and there is a need for better examples. To improve this situation, I decided to create three wrapper C++ classes which provide the following; queuing work items, associating callbacks with events and timer functionality.

You can directly use these wrapper classes or look at the source to understand how to use the Threadpool APIs. These classes are header only code in the windowsthreadpool namespace and can be used by including the header file “WindowsThreadPool.h”. The entire source code is available on MSDN Code Gallery. A little background on threadpools: Threads are the basic abstraction used to schedule work on the CPU in Windows. Explicitly managing thread lifetimes is cumbersome from a coding perspective and can degrade system and application performance if the lifetimes are managed poorly.

Void CALLBACK FunctionName(PVOID state) Example Usage: #include <tchar.h> private: Guidelines for Applications (Windows) - Iceweasel. Best Practices for Creating DLLs - Iceweasel. Creating DLLs presents a number of challenges for developers. DLLs do not have system-enforced versioning. When multiple versions of a DLL exist on a system, the ease of being overwritten coupled with the lack of a versioning schema creates dependency and API conflicts.

Complexity in the development environment, the loader implementation, and the DLL dependencies has created fragility in load order and application behavior. Lastly, many applications rely on DLLs and have complex sets of dependencies that must be honored for the applications to function properly. This document provides guidelines for DLL developers to help in building more robust, portable, and extensible DLLs. General Best Practices Some initialization tasks cannot be postponed. Deadlocks Caused by Lock Order Inversion When you are implementing code that uses multiple synchronization objects such as locks, it is vital to respect lock order. Best Practices for Synchronization Recommendations. Effective minidumps (MiniDumpWriteDump, MiniDumpCallback) - Iceweasel. Updated: 07.02.2005 Contents Introduction In the last couple of years, crash dumps became an important part of our debugging activities.

The possibility to create a snapshot of the application state at the exact moment of failure and analyze it with a conventional debugger running on the developer’s machine is invaluable when our software fails on the customer’s site or in the test lab. The first generation of crash dumps, often called “full user dumps”, captured the whole contents of the process’ virtual memory.

A new family of crash dumps, called “minidumps”, came to us together with Windows XP. The customisable nature of minidumps brings us the question – how much information about the application’s state do we need to debug effectively and at the same time keep the minidumps as small as possible? Fortunately, DbgHelp functions (MiniDumpWriteDump and MiniDumpCallback) give us such level of control, and even more. Minidump types Lets start with some code. Figure 1: Figure 2: Figure 3: GDI+ FAQ main index - Iceweasel. Welcome : GDI+ FAQ GDI+ is a native C++ DLL that was originally created for the Microsoft Office suite. It has graphical capabilities that were far in advance of the original Windows graphics system, GDI. For .Net, and particularly Windows Forms, GDI+ was given a managed wrapper that enabled it to be used with C# and VB.Net. For many years GDI+ has provided a sterling service, enabling Windows Forms applications to show really great graphics.

Unfortunately, the adoption of GDI+ never really sparked the imaginations of the graphics card manufacturers and therefore hardware acelleration was only provided by a few graphics cards from the Matrox corporation. Because GDI+ never took off as a serious games graphics engine, the manufacurers preferred to concentrate on the capabilities of DirectX. This list of articles that began on another site in 2001 contains many real world examples of how to get the best from GDI+. Bob Powell Create your badge. "How Do I?" Videos for Native Coding - Iceweasel. MFC Windows Coding Guidelines - CodeProject - Iceweasel. Contents Prerequisites By function I mean: global function static/instance method Carefully read the documentation/Press F1 (Ctrl-F1) if you are not sure about something Switch these options on in your Visual Studio project options C++ - General Warning level - Level 4 (All builds) Make sure your code compiles without any single warning.

After switching to warning level 4 (or, what is worse even before) you may encounter many warnings. Rewriting some code (recommended) Using casting – but be very, I repeat very careful with it. Use ASSERT macro as often as possible _ASSERTE, ASSERT (MFC/ATL), assert (standard C++) These macros are removed during preprocessing in release builds along with expressions passed to them so they don’t hurt performance in final build at all. They take boolean expression as parameters or any expression than can be implicitly converted to boolean. Always check for correctness of parameters passed to the function (especially pointers).

Use exact type Avoid casting Do this::

MFC

Visual C++ Tips and Tricks | www.catch22.net - Iceweasel.