Windows入門程式設計程式筆記(一)

2021-09-27 03:16:00 字數 3629 閱讀 4311

參考:

呼叫約定

有點神奇的字元

手敲基礎**

滾動條

#include 

#include

int winapi

winmain

(hinstance hinst,

hinstance tmp,

lpstr strcmd, int nshow)

int messageboxprint

(const char *szformat,

...)

int winapi

winmain

(hinstance hinst,

hinstance

,lpstr strcmd, int nshow)

程式入口點從winmain開始,當在呼叫mbp函式前,會將用到的引數壓入棧,並儲存本地程式的位址,使用另外乙個指標執行mbp函式,將用到的變數也壓入棧,若需要傳入的引數,則從剛剛儲存的本地位址往回找。 待續

;}白板視窗 hwnd = createwindow(classname, text(「hello」), ws_popup, 0, 0, getsystemmetrics(sm_cxscreen), getsystemmetrics(sm_cyscreen), null, null, hinst, null);

#include "stdafx.h"

#include

#define num

1000

lresult

callback

wndproc

(hwnd

,uint

,wparam

,lparam);

int winapi

winmain

(hinstance hinst,

hinstance

,lpstr sccmd,int nshow)

cxscreen =

getsystemmetrics

(sm_cxscreen);

cyscreen =

getsystemmetrics

(sm_cyscreen);

hwnd =

createwindow

(classname,

text

("hello"),

|ws_vscroll

,200

,200

,800

,500

,null

,null

, hinst,

null);

if(hwnd==

null

)showwindow

(hwnd,nshow)

;updatewindow

(hwnd)

;while

(getmessage

(&msg,

null,0

,0))

}lresult

callback

wndproc

(hwnd hwnd,

uint message,

wparam wparam,

lparam lparam)

si.fmask =

sif_pos

;setscrollinfo

(hwnd,

sb_vert

,&si,

true);

getscrollinfo

(hwnd,

sb_vert

,&si);if

(position !=si.npos)

return0;

case

wm_destroy

:postquitmessage(0

);return0;

case

wm_paint

: si.fmask =

sif_pos

;getscrollinfo

(hwnd,

sb_vert

,&si);

hdc =

beginpaint

(hwnd,

&pt)

;for

(i =

0; i <

num;i++

)endpaint

(hwnd,

&pt)

;return0;

default:;

}return

defwindowproc

(hwnd,message,wparam,lparam)

;}

windows網路程式設計入門

windows sockets 的版本 標頭檔案 winsock.h 庫檔案 wsock32.lib 動態困 winsock.dll 標頭檔案 winsock2.h 庫檔案 ws2 32.lib 動態困 ws2 32.dll 服務端 wsadata wsd wsadata變數 socket sser...

windows程式設計筆記

在複習socket通訊時遇到了i o復用技術這個問題,由這個問題引申出了select模型,i o通訊模型的問題,在windows下對其進行了實現。但是很多概念性的東西不是很明白,於是檢視了 windows核心程式設計 這本書,不得不說這本書對windows的很多東西講的很透徹,因為時間的原因,只專門...

Windows 程式設計入門(一) Unicode

by wjb date 2018 08 03 本質上,unicode 使用16位數表示字元。unicode字符集很大,它可以支援世界上很多國家的語言文字或其他符號。在 c 中,我們用寬字元型別 wchar t 來表示 unicode 字元。在 32 和 64 位windows 中,wchar t 都...