473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

WndProc problems

I'm having problems with the reliability of WndProc in my application. The
application has a hidden form, which it instantiates in the Main() and then
calls Application.Run(). There are cases where WndProc does not receive
internal messages via PostMessageA(). Sometimes it works, sometimes it
doesn't. It seems that calling Application.Run(New Form()) works, but since
the form needs to be hidden, this isn't a viable option. Has anyone else
experienced these kind of issues? It just seems that WndProc is very flaky.
Thanks.

-Mike

Nov 21 '05 #1
4 1519
Hi,

Try setting the forms opacity to 0 instead of visible=false to
hide the form.

Ken
-----------------
"mike2036" <mi******@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
I'm having problems with the reliability of WndProc in my application.
The
application has a hidden form, which it instantiates in the Main() and
then
calls Application.Run(). There are cases where WndProc does not receive
internal messages via PostMessageA(). Sometimes it works, sometimes it
doesn't. It seems that calling Application.Run(New Form()) works, but
since
the form needs to be hidden, this isn't a viable option. Has anyone else
experienced these kind of issues? It just seems that WndProc is very
flaky.
Thanks.

-Mike

Nov 21 '05 #2
Hi Ken,

I tried that. The problem is the form is still visible in the taskbar. I
also set the ShowInTaskBar to false, but it can be seen when you Alt+Tab
through the running applications.

-Mike
"Ken Tucker [MVP]" wrote:
Hi,

Try setting the forms opacity to 0 instead of visible=false to
hide the form.

Ken
-----------------
"mike2036" <mi******@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
I'm having problems with the reliability of WndProc in my application.
The
application has a hidden form, which it instantiates in the Main() and
then
calls Application.Run(). There are cases where WndProc does not receive
internal messages via PostMessageA(). Sometimes it works, sometimes it
doesn't. It seems that calling Application.Run(New Form()) works, but
since
the form needs to be hidden, this isn't a viable option. Has anyone else
experienced these kind of issues? It just seems that WndProc is very
flaky.
Thanks.

-Mike


Nov 21 '05 #3
I am not sure, unless the form is loaded, it's window gets registered. So
you may want to call Show on it and then hide the form in its Load event.

"mike2036" wrote:
I'm having problems with the reliability of WndProc in my application. The
application has a hidden form, which it instantiates in the Main() and then
calls Application.Run(). There are cases where WndProc does not receive
internal messages via PostMessageA(). Sometimes it works, sometimes it
doesn't. It seems that calling Application.Run(New Form()) works, but since
the form needs to be hidden, this isn't a viable option. Has anyone else
experienced these kind of issues? It just seems that WndProc is very flaky.
Thanks.

-Mike

Nov 21 '05 #4
Thanks for the advice!

"TrtnJohn" wrote:
I am not sure, unless the form is loaded, it's window gets registered. So
you may want to call Show on it and then hide the form in its Load event.

"mike2036" wrote:
I'm having problems with the reliability of WndProc in my application. The
application has a hidden form, which it instantiates in the Main() and then
calls Application.Run(). There are cases where WndProc does not receive
internal messages via PostMessageA(). Sometimes it works, sometimes it
doesn't. It seems that calling Application.Run(New Form()) works, but since
the form needs to be hidden, this isn't a viable option. Has anyone else
experienced these kind of issues? It just seems that WndProc is very flaky.
Thanks.

-Mike

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Beach Potato | last post by:
Hi: I've searched newsgroups and various archives, including MSDN & MFC sources, but at this point failed to locate an accurate and simple implementation of WndProc function for MSWindows window...
0
by: sshuangw | last post by:
Hello: I am encountering a very weird issue with MDI child, Overriden WndProc function and hidden form. Basically, the application has two forms, Form1(parent form), Form2(Child form),...
2
by: Ed Sutton | last post by:
How can a WndProc be created inside a component? Currently I have a WndProc in my frmMain. It looks for WM_DEVICECHANGE messages for connection and removal events for a USB/Serial device. My...
0
by: cyrille | last post by:
Hello from example from web i did a little code to avoiding columnHeader resize. this code seems to work well, but when I put a 'normal' ListView on the same Form than my overrided ListView it...
4
by: crafuse | last post by:
Hello, I've overridden the WndProc function in my form to hand some special behavior. Specifically, I look for the WM_NCMOUSEMOVE event to tell me when the user is trying to move the window by...
3
by: S Wheeler | last post by:
Hi - I have a vc++ WinForms app. Can I override the WndProc so I can send custom messages to my app. Is there any way to do this? I need to notify the main form of events from a library. How is...
2
by: Chris Ashley | last post by:
Hi, I'm overriding WndProc to process some custom messages like so: protected override void WndProc(ref Message m) { if (m.Msg == ImageFileMsg.MSG_IF_NEW_DATA) { ProcessNewDataMessage(m);
4
by: Rob | last post by:
I've constructed a user control inherited from ListView so I can handle and respond to scrolling events (to keep 2 listviews scrolling in sync). My user control includes an Overrides of WndProc...
0
by: Ron | last post by:
I'm having trouble capturing key events in my Custom Designer using WndProc: (in Design mode) What am I missing?? Thanks, Ron private const int WM_MOUSEMOVE = 0x0200;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.