Re: [問題] 視窗化程式設定
※ 引述《ddv70 (大David為)》之銘言:
: 我是使用vc2010
: include windows.h
: 之前co了一段sample code 但是結果視窗卻很小
: cvNamedWindow("status", 0); // test
: Window = (HWND) cvGetWindowHandle("status");
: Window = GetParent(Window) ;
: style = GetWindowLong( Window, GWL_EXSTYLE);
: style = style | WS_EX_LAYERED;
: SetWindowLong( Window, GWL_EXSTYLE, style);
: SetLayeredWindowAttributes(Window, RGB(255,255,255), 0, LWA_COLORKEY);
: style = GetWindowLong(Window, GWL_STYLE);
: style = GetWindowLong(Window, WS_MAXIMIZE);
: style = style & (~WS_CAPTION) & ~(WS_BORDER) & ~WS_THICKFRAME & WS_MAXIMIZE;
: SetWindowLong( Window,GWL_STYLE, style);
: 請問要怎麼設定成全螢幕大小且底色為透明之程式???
: 萬分感謝大家解答
首先,創造視窗前 要先知道你電腦螢幕解析度
Win32API 有個function GetSystemMetrics 可以取得螢墓解析度
範例:
int x=GetSystemMetrics(SM_CXSCREEN); //取得寬度
int y =GetSystemMetrics(SM_CYSCREEN); //取得高度
附上msdn連結
http://ppt.cc/3zQL
而 CreateWindow 的style
設定成 WS_EX_TOPMOST | WS_POPUP
視窗寬高 則設定剛取得的x,和y 視窗位置則設0 ,0
即可
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.129.38.44
※ 編輯: sand1050 來自: 140.129.38.44 (01/05 20:45)
推
01/05 21:34, , 1F
01/05 21:34, 1F
→
01/05 21:34, , 2F
01/05 21:34, 2F
→
01/05 21:35, , 3F
01/05 21:35, 3F
→
01/05 21:37, , 4F
01/05 21:37, 4F
推
01/05 21:51, , 5F
01/05 21:51, 5F
→
01/05 21:57, , 6F
01/05 21:57, 6F
→
01/05 21:59, , 7F
01/05 21:59, 7F
討論串 (同標題文章)