window-style

`SetWindowLong()` function doesn't change window style even after calling `SetWindowPos()`

故事扮演 提交于 2021-02-10 12:15:26
问题 I create the static control with the code below: hWnd = CreateWindowExW( 0, L"STATIC", Content.c_str(), SS_LEFT | WS_VISIBLE | WS_CHILD /*| SS_SUNKEN*/, 200, 120, 120, 40, hWndParent, NULL, hInstance, NULL); If I enable the SS_SUNKEN style in the creation code above, the created static control appears sunken successfully. But, what I'm trying to do is the change the control style after its creation. I tried this: void BaseWindowClass::AddStyle(DWORD NewStyle) { // NewStyle = 0x00001000 = SS

`SetWindowLong()` function doesn't change window style even after calling `SetWindowPos()`

梦想与她 提交于 2021-02-10 12:14:27
问题 I create the static control with the code below: hWnd = CreateWindowExW( 0, L"STATIC", Content.c_str(), SS_LEFT | WS_VISIBLE | WS_CHILD /*| SS_SUNKEN*/, 200, 120, 120, 40, hWndParent, NULL, hInstance, NULL); If I enable the SS_SUNKEN style in the creation code above, the created static control appears sunken successfully. But, what I'm trying to do is the change the control style after its creation. I tried this: void BaseWindowClass::AddStyle(DWORD NewStyle) { // NewStyle = 0x00001000 = SS

Win32 prevent window “snap”

扶醉桌前 提交于 2021-01-28 07:43:26
问题 How can I disable the snap feature of Windows 7 for my application (progmatically)? Or is there any way to detect if the application has been snapped, and specifically call an API function to unsnap it? Calling SetWindowPos() or ShowWindow() does not unsnap it correctly *(SW_MAXIMIZE does). Calling SetWindowPos() actually causes strange behavior in future calls to SetWindowPos() and MoveWindow(). The same inconsistencies do not apply to a window that is maximized. 回答1: I figured out a way to

Toggle Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden at runtime

北城以北 提交于 2020-01-09 08:11:28
问题 I want to toggle a process's visibility at runtime , I have a Windows Form app that starts via a process another console app hidden by default but I'd like to allow the admin user to toggle this state via a checkbox and show the console app if they choose. I have this but it's not working: private void checkBox1_CheckedChanged(object sender, EventArgs e) { ProcessWindowStyle state = cvarDataServiceProcess.StartInfo.WindowStyle; if (state == ProcessWindowStyle.Hidden) cvarDataServiceProcess

Getting window style

孤街浪徒 提交于 2019-12-22 09:55:11
问题 I'm trying to check if a window has a certain style using GetWindowLong(hWnd, GWL_STYLE) but that gives me a LONG type of variable. how would you check for a specific style from that say a const value type 'WS_CAPTION'? 回答1: use the bitwise & operator to compare with that long type, example if (szLng & WS_CAPTION){ // that window has caption } 回答2: Most of the window styles WS_ are single-bit values; that is each of them occupies only one bit in dwStyles. Here dwStyles can be obtained from:

Getting window style

≯℡__Kan透↙ 提交于 2019-12-05 22:19:52
I'm trying to check if a window has a certain style using GetWindowLong(hWnd, GWL_STYLE) but that gives me a LONG type of variable. how would you check for a specific style from that say a const value type 'WS_CAPTION'? use the bitwise & operator to compare with that long type, example if (szLng & WS_CAPTION){ // that window has caption } Mike Most of the window styles WS_ are single-bit values; that is each of them occupies only one bit in dwStyles. Here dwStyles can be obtained from: DWORD dwStyles = CWnd::GetStyle(); But some of the WS_ styles, such as WS_CAPTION , WS_OVERLAPPEDWINDOW , WS