Re: pass parameter between main thread and working thread

Tech-Archive recommends: Fix windows errors by optimizing your registry



<Jose de Alba> wrote:
Question, how do you use PostMessage(...) when working with
non-window apps, (e.g. console apps as in my case?)

Does a main thread in a console have a HWND ?

If you want to use windows messages as a communication mechanism
between threads, then you can create message-only window (search
for "HWND_MESSAGE" in MSDN) in main thread and post messages to it
with `PostMessage' from working threads. You'll need to mainatin
message loop in main thread, too. On start no thread has windows
by default.

HTH
Alex


.



Relevant Pages

  • Re: pass parameter between main thread and working thread
    ... non-window apps, (e.g. console apps as in my case?) ... Does a main thread in a console have a HWND? ... Just use PostThreadMessage to send and run a GetMessage loop ...
    (microsoft.public.vc.language)
  • Re: DataAdapter/DataSet in non-form application??
    ... Probably because console apps and classes in class libraries typically do ... not require WYSIWYG type design. ... Where as windows and web forms do. ... useless - there is no design surface to speak of. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Accessing network drive from Windows Service
    ... You need to change the account that the service runs under to the ... > I Think it's the stupidness of Windows. ... > console apps, then call it with your windows service.. ... > "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Fatal bug in DDK sample?
    ... >> Console apps can create a hidden window. ... > Nice trick, thanks. ... The console app can create the visible windows too, ... Maxim Shatskih, Windows DDK MVP ...
    (microsoft.public.development.device.drivers)
  • Re: Proposal: ConsoleVision
    ... I still write console apps and ended up rewriting the Crt unit (using ... Any decently written Windows app fulfills these ... suggesting writing huge complicated apps with TV, ... Want native support in Delphi for AMD64/EM64T? ...
    (borland.public.delphi.non-technical)