窗口风格对窗口有很多影响,我先简单将一些使用常见窗口风格的结果,展现如下。我们知道
· WS_BORDER Creates a window that has a border.
· WS_DLGFRAME Creates a window with a double border but no title.
· WS_CAPTION Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style.
· WS_THICKFRAME Creates a w...
UI界面阅读全文
1.枚举所有的进程
方法很多,这里用EnumProcesses这个方法
DWORD aProcesses[1024], cbNeeded, cProcesses; unsigned int i;
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) ) return;
cProcesses = cbNeeded / sizeof(DWORD);
for ( i = 0; i < cProcesses; i++ ) PrintProcessNameAndID( aProce...
windows_API阅读全文
1.获取所有的驱动器 利用函数 GetLogicalDriveStrings
The GetLogicalDriveStrings function fills a buffer with strings that specify valid drives in the system.
DWORD GetLogicalDriveStrings( DWORD nBufferLength, // size of buffer LPTSTR lpBuffer // drive strings buffer );
很简单的一个函数,msdn有详细的说明 需要注意的一点是
lpBuf...
windows_API阅读全文
在SDK,进行windows程序设计(不使用mfc),使用这些控件,要进行一些必要的初试化,否则如果在对话框上画这些控件,对话框就不能正常显示
先说Rich Edit控件,这个是个特例。
如果往对话框里添加了一个Rich Edit控件,然后运行程序.理应弹出对话框,但是没有弹出. 如果把Rich Edit 控件去掉,再运行.对话框就可以弹出。
如果在mfc下进行开发,那么只要程序启动的时候添加AfxInitRic...
windows_API阅读全文
这段代码太好了,跟大家一起分享它。
//左上角到右下角画直线. // //caimouse 2007/02/11 // bool CSurface::LeftTopToRightBottom(int nXStart,int nYStart,int nDeltaX,int nDeltaY) { // int nDelta = CNOS_NS::Max(nDeltaX,nDeltaY);
//计算判断符号,除2. int nError = nDelta>>1;
// if (nDeltaX < nDeltaY) { for (int i = 0; i < nDelta; i++) { ...
代码集锦阅读全文
RT:本文仅供学习交流,勿做他用。例如有道词典左下方,有提示学习英语的广告。很简答。
#include <windows.h>
#include <iostream> using namespace std;
int main(void) {
HWND hParentWnd = FindWindow(L"YodaoMainWndClass", NULL);
HWND hChildWnd = FindWindowEx(hParentWnd, NULL, L"Afx:00400000:0", L"InfoBar");
ShowWindow(hChildWnd, SW_HIDE);
return 1;...
VC阅读全文