473,387 Members | 1,942 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,387 software developers and data experts.

RemoveMenu or EnableMenuItem not always working

Joe
I have a MDI app where 2 children forms should never be closed. I'm using
RemoveMenu API to remove the close X and context menu item. This works fine
on one form but not on the other. The major difference between these 2 forms
is that the one that doesn't work has an ActiveX control.

If I can put the RemoveMenu() in the Activate event of the form it will work
after reactivating the form by clicking on another form then back again.
This has 2 problems though. First the user could close the form as long as
the form didn't become deactive and second, the Windows top bar where the
Control box it located no longer works so the form can't be dragged and also
can't be double clicked to maximize the window.

If I call GetLastError() after calling DrawMenuBar() it returns 1400 -
Invalid window handle.

Any ideas why? Could the ActiveX control be causing the problem?

Thanks,
Joe
Nov 17 '05 #1
1 3240
Joe
Fixed the invalid window handle problem. I was passing the hmenu to the
DrawMenuBar() instead of the form.handle.

BUT I still have the problem where the form with the ActiveX control doesn't
disable to menu item.
"Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message
news:#J**************@tk2msftngp13.phx.gbl...
I have a MDI app where 2 children forms should never be closed. I'm using
RemoveMenu API to remove the close X and context menu item. This works fine on one form but not on the other. The major difference between these 2 forms is that the one that doesn't work has an ActiveX control.

If I can put the RemoveMenu() in the Activate event of the form it will work after reactivating the form by clicking on another form then back again.
This has 2 problems though. First the user could close the form as long as
the form didn't become deactive and second, the Windows top bar where the
Control box it located no longer works so the form can't be dragged and also can't be double clicked to maximize the window.

If I call GetLastError() after calling DrawMenuBar() it returns 1400 -
Invalid window handle.

Any ideas why? Could the ActiveX control be causing the problem?

Thanks,
Joe

Nov 17 '05 #2

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

Similar topics

8
by: yuri | last post by:
Hi all At coding XP Themes i can't get "GetThemeColor" to work. It always fails ("not found" err. code) regardless of which control parts and states entered. Could somebody help me with advice?...
3
by: r.manders | last post by:
In visual Studio .Net when I start a program in the debugger, it always starts building all included project files. This only happens since a few weeks, before that it just started the program,...
0
by: Joe | last post by:
I have a MDI app where 2 children forms should never be closed. I'm using RemoveMenu API to remove the close X and context menu item. This works fine on one form but not on the other. The major...
10
by: Bob | last post by:
Apparently customizing the system menu in a Form requires API calls... that's fine, but RemoveMenu doesn't work. Will I have to pop up my own menu to get rid of certain selections? Bob
5
by: Jeff | last post by:
Hi I have an Access database that I use to keep track of hours I work on development. The database is always open and minimised. An annoying problem is that whenever I open a database I am...
19
by: youpak2000 | last post by:
Are MAGIC numbers always bad? Using magic numbers (constant numbers) in programs are generally considered a bad programming practice, and it's recommended that to define constants in single,...
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
2
by: Joe Rattz | last post by:
I am trying to create an XmlReader using XmlReader.Create, but it always returns {None}. I have tried several examples from the web, and Create always returns "{None}". Here is my code: ...
6
by: KDawg44 | last post by:
Hi, My responseXML is always null on my AJAX call. When I browse directly to the PHP script I am calling, the XML file shows up just fine. I have read that if a returned XML file is not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.