WndProc without visible form?

I want to create a form in a second thread that will receive WndProc messages in it. What is the recommended way to create an invisible form? Is setting "ShowInTaskbar = false" and "Visible = false" enough, or is there a "cleaner" way?

+3
source share
5 answers

I'm not sure what you mean by "cleaner." The standard way to create a form that is not visible to the user is to set Visible and ShowInTaskbar to false.

+2
source

, , , ( )... UI .

, Visible false. , ShowInTaskbar , , .

0

:

Public Declare Function CreateWindowExA Lib "user32" (ByVal dwExStyle As Long, 
    ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, 
    ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, 
    ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) 
    As Long

Public Declare Function CreateWindowExW Lib "user32" (ByVal dwExStyle As Long, 
    ByVal lpClassName As Long, ByVal lpWindowName As Long, ByVal dwStyle As Long, 
    ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, 
    ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Long) 
    As Long

: lpClassName lpWindowName string long "Static" lpClassName - , , wndproc.

api - hwnd (handle), Windows , .

: hwnd_main - hwnd

dim hwnd_recieve as long
hwnd_recieve = CreateWindowEx(num_zero, "Static", "",0,0,0,0,0, hwnd_main,0,0,0)

!

0

: http://www.codeproject.com/KB/dotnet/XDMessaging.aspx

, , , .

XDListener NativeWindow, . , . WndProc . , Win 7 #, TaskBar.

0

Windows, ShowInTaskbar false. - ( ).

0

Source: https://habr.com/ru/post/1708680/


All Articles