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

undefined SW_MAXIMIZE for ShowWindow function

Hi!

I'm trying to maximize a IE window. I have a handler and I'm trying to
call ShowWindow to maximize it:

ie = Dispatch('InternetExplorer.Application')
handler = ie.HWND
ie.Visible = 1
win32gui.ShowWindow(handler, SW_MAXIMIZE)

But then I get this error:
'SW_MAXIMIZE' is not defined

The function ShowWindow is defined (according to MSDN) as:

BOOL ShowWindow( HWND hWnd,
int nCmdShow
);

How do I get SW_MAXIMIZE to be defined?

Jul 14 '06 #1
6 4576
OK, so it it turns out, the window will maximize when SW_MAXIMIZE =3.
But where can I find some documentation for that?

Etayki wrote:
Hi!

I'm trying to maximize a IE window. I have a handler and I'm trying to
call ShowWindow to maximize it:

ie = Dispatch('InternetExplorer.Application')
handler = ie.HWND
ie.Visible = 1
win32gui.ShowWindow(handler, SW_MAXIMIZE)

But then I get this error:
'SW_MAXIMIZE' is not defined

The function ShowWindow is defined (according to MSDN) as:

BOOL ShowWindow( HWND hWnd,
int nCmdShow
);

How do I get SW_MAXIMIZE to be defined?
Jul 14 '06 #2

[Etayki]
How do I get SW_MAXIMIZE to be defined?
It's in win32con. Like this:
>>from win32con import *
SW_MAXIMIZE
3

--
Richie Hindle
ri****@entrian.com
Jul 14 '06 #3
"Etayki" <et*****@gmail.comwrote:
I'm trying to maximize a IE window. I have a handler and I'm trying to
call ShowWindow to maximize it:

ie = Dispatch('InternetExplorer.Application')
handler = ie.HWND
ie.Visible = 1
win32gui.ShowWindow(handler, SW_MAXIMIZE)

But then I get this error:
'SW_MAXIMIZE' is not defined
SW_MAXIMIZE is a C preprocessor constant (a define), which means it
only exists in a Windows-specific header file (winuser.h, in this case).
How do I get SW_MAXIMIZE to be defined?
by grepping through the Windows header files to see what the corresponding
value is, and using that value to set a Python variable in your script:
grep SW_MAXIMIZE *.H
WINUSER.H:#define SW_MAXIMIZE 3

corresponds to

SW_MAXIMIZE = 3

</F>

Jul 14 '06 #4
>How do I get SW_MAXIMIZE to be defined?
>
by grepping through the Windows header files to see what the corresponding
value is, and using that value to set a Python variable in your script
oops. thought you were using ctypes, not the pythonwin extensions. see richie's
reply for pythonwin details.

</F>

Jul 14 '06 #5

[Etayki]
OK, so it it turns out, the window will maximize when SW_MAXIMIZE =3.
But where can I find some documentation for that?
ShowWindow is a Win32 API call, so Googling within msdn.microsoft.com will
usually get you straight to the relevant documentation:

http://www.google.com/search?q=ShowW....microsoft.com

--
Richie Hindle
ri****@entrian.com
Jul 14 '06 #6

[Fredrik]
oops. thought you were using ctypes, not the pythonwin extensions.
Even when I'm using ctypes I use win32con for the constants, unless
there's some special reason why I need the code to be independent of
pywin32.

--
Richie Hindle
ri****@entrian.com
Jul 14 '06 #7

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

Similar topics

2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
13
by: david | last post by:
Hi, I have some problems to link a simple hello world program using g++ (version 3.2.3 or 3.3) and dinkumware 402. //hallo world... #include <iostream> main () { std::cout << "bla" <<...
0
by: kurotsuke | last post by:
I'm using the ShowWindow API to show a form (I need it to show the form topmost without focus). My form has no titlebar and should have a height of 16 pixel. When the form is shown it's height is...
17
by: yb | last post by:
Hi, Looking for clarification of undefined variables vs. error in JavaScript code. e.g. <script> alert( z ); // this will be an error, i.e. an exception </script>
2
by: vooose | last post by:
Form form = new Form(); when you call ShowWindow(form, SW_SHOWNOACTIVATE); the form disappears the next time the garbage collector is called, assuming the form variable has gone out of...
3
by: Michael Sgier | last post by:
Hi i get thousands of messages like below. How shall i resolve that? Thanks Mcihael Release/src/Utility/RawImage.o: In function `CMaskImage::CMaskImage(int, int, char const*)':...
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
3
by: prakash.mirji | last post by:
Hello, I am getting below mention linker error when I tried to link my class test.C I use below command to compile test.C /usr/bin/g++ -g -fpic -fvisibility=default -D_POSIX_SOURCE...
1
by: Leatherface123 | last post by:
hi, i'm just learning C++. I want to make a button disappear when the user unchecks a checkbox, and make it reappear when he checks the box again. the problem is, the line GetDlgItem(IDC_RUNPGM)...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.