This example can be downloaded from my resources to fully executable source code.Http://download.csdn.net/source/463257Introduction
This article is for those who did not find, any useful code examples and information regarding ListControl (ListView). For me, it was really hard to get a working code for Win32 API, since I don't code in MFC. The only help I was able to get wasWin32.hlpWhich contains every
This isIt is used in the C/S windows System for the customer service call center project. One module needs to call out hot keys like QQ, So I summarized the Code in this regard.
// API-assisted operationsUsing System;
Using System. Windows. Forms; // for Key namespace
Using System. Runtime. InteropServices; namespace hotkeytest
{
/// /// WIN32 Windows API-assiste
In the. NET Framework Program Using the Win32 API through dllimportThe. NET Framework Program can access the local machine through the static DLL entry point. Code Library. The dllimport attribute is used to specify the DLL location that contains the implementation of an external method.The dllimport attribute is defined as follows:Namespace system. runtime. interopservices{[Attributeusage (attributetargets
Use Win32 API in Delphi to create built-in thread functions for message Loops
1. Thread CreationHandle createthread (Lpsecurity_attributes lpthreadattributes,// Pointer to thread security attributesDWORD dwstacksize, // initial thread stack size, in bytesLpthread_start_routine lpstartaddress, // pointer to thread functionLpvoid lpparameter, // argument for new threadDWORD dwcreationflags, // creation flagsL
Review Win32 API and win32api
A friend said that the print window function should be added to a project developed by VC ++ 6.0 to help write code for its call. Of course, I don't want to touch this old IDE, and I don't like the clumsy and unclear encapsulation of MFC. So I decided to use a pure Win32 API and then simpl
Use Win32 API to synchronize producer and consumer threads.
Use win32 API to create a thread and create a semaphore for Thread Synchronization
Create semaphores
Syntax:
HANDLE semophore;semophore = CreateSemaphore(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
The following is a prototype of the Creat
#include "windows.h" #include "tchar.h" int apientry _twinmain (hinstance hinstance,hinstance hprevinstance,lptstr Lpcmdline,int ncmdshow) {MessageBox (NULL, Text ("hello,world!"), text ("haha"), MB_OK); return 0;}When using _tWinMain as the entry function, the third parameter type should be defined as LPTSTR, which represents the WCHAR * type#include "windows.h" #include "tchar.h" int apientry WinMain (hinstance hinstance,hinstance hprevinstance,lpstr Lpcmdline,int ncmdshow) {MessageBox (NULL,
Controls created with the CreateWindow function, if you want to switch with the TAP key, the simplest way is: the main window has ws_ex_controlparent extension properties, the control has ws_tapstop properties.Then the most important thing is to make a judgment when dealing with the message loop : 1 while(GetMessage (msg, NULL,0,0))2 {3 if(! IsDialogMessage (hwnd, AMP;MSG))//Not the HWND, not the message.4 {5TranslateMessage (msg);6DispatchMessage (msg);7 }8 9}
This blog mainly describes how to use Win32 API to compile a system tray. The following functions are implemented: Display prompt box, bubble, and context menu. Implementation System
The main function used in the system tray is shell_policyicon, And the struct used is policyicondata.
After running, we can see our tray in the taskbar.
When we move the mouse over the tray icon, right-click the context menu, w
title bar button in pixels.23.Sm_cxsmicon, Sm_cysmicon: small icon size in pixels, small icons generally appear on the title bar24.Sm_cxvscroll,Sm_cyvscroll the width of the vertical scrollbar calculated in pixels and the height of the arrows on the vertical scroll bar25.Sm_cycaption the height of a normal window caption calculated in pixels26.Sm_cymenu the height of a single menu bar calculated in pixels27.Sm_cysmcaption the height of the small title bar of a window calculated in pixels28.Sm_c
, the number of customizations and item values and key names, register first, run ctrl.htm can
三、一个 bar control, implements a similar function with the pie chart control, also can customize item name and item value in IE, run rectctrl.htm can
四、一个 ActiveX controls, which are composite controls, contain a subclass tab control and a pie chart control (the tab control contains a pie chart control) and run tab.htm.
How far the tree control of the Windows tree control, can customize the tree struc
We continue to Win32 the topic of debugging APIs. In this chapter, we will learn how to modify the debugger.
Theory:
In the previous chapter, we learned how to load the process being debugged and how to handle events that occurred in the process. For practical purposes, our program should have the ability to modify the program being debugged. There are several API functions for this purpose.
ReadProcessM
Qt sends messages to Win32 very easily, but it is very complicated to obtain Windows messages. Finally, I thought of a method that is not perfect, but it is also the only way that I can achieve it now, the basic principle is to use VC to compile an mfc dll, which creates a transparent form and uses this DLL to obtain Win32 API messages.
The source code has been
this is a global function to distinguish it from the member functions of C + + classesMove the cursor to the API function, press F1 to open the MSDN documentation============================= Code Style =======================G_ prefixes represent global variablesM_ prefixes represent member variables of a classB_ prefix denotes bool typeN_ prefix denotes integral typeThe P_ prefix represents the pointerThe LP_ prefix represents the long pointer=====
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.