vs08新建win32空白專案 屬性設定

2021-06-19 00:31:54 字數 1456 閱讀 2491

c/c++ 預處理器定義 win32;_debug;_windows;unicode

鏈結器-系統 子系統選擇windows

其實沒有這麼麻煩~

新增->新建專案->visual c++-> win32 專案->下一步->windows 應用程式 (空專案)

之後,原始檔->新增->新建項->c++檔案->m.c

就可以寫程式了,

至於依賴庫 寫程式的時候用到再加就行了~

window程式設計,訊息處理模版

#include "windows.h"

lresult callback wndproc(hwnd hwnd,uint message,wparam wparam,lparam lparam);

int winapi winmain( __in hinstance hinstance, __in_opt hinstance hprevinstance, __in_opt lpstr lpcmdline, __in int nshowcmd )

hwnd=createwindow(

szwindowsname,

cw_usedefault,//初始位置

cw_usedefault,

cw_usedefault,

cw_usedefault,

null,

null,

hinstance,

null);

showwindow(hwnd,nshowcmd);

updatewindow(hwnd);

//wrong

//while (getmessage(&msg,hwnd,null,null))

while (getmessage(&msg,null,null,null))

return 0;

}lresult callback wndproc(hwnd hwnd,uint message,wparam wparam,lparam lparam)

//wrong

//defwindowproc(hwnd,message,wparam,lparam);

//return 0;

return defwindowproc(hwnd,message,wparam,lparam);

}

lresult callback wndproc(hwnd hwnd,uint message,wparam wparam,lparam lparam)

//wrong

//defwindowproc(hwnd,message,wparam,lparam);

//return 0;

return defwindowproc(hwnd,message,wparam,lparam);

}

win7下主題要用windows經典才能看出遮擋效果……

VS建立空的Win32程式

在visual studio中直接新建空專案在 中加入windows入口點的 編譯會發生錯誤,但是新建windows桌面應用程式初始的 和資源太多,本文將給出建立空win32專案的方法 新建空專案 右鍵單擊解決方案下的工程 本例中為sample 點選屬性 r 在鏈結器中系統選項下的子系統設定為 視窗...

在vs2003的Win32專案中使用 MFC

進入 project setting c c page,做以下修改 1 在preprocessor definitions中加入 afxdll,加入後的設定大概是這樣的 win32,debug nodebug,console mbcs afxdll 加入的 afxdll是關鍵 它欺騙mfc lib,...

win32學習08 鍵盤滑鼠定時器訊息

鍵盤和滑鼠的訊息引數 lresult callback windowproc hwnd hwnd,handle to window uint umsg,wm keydown wparam wparam,virtual key code lparam lparam key data wparam 按鍵...