|
Dear all,
I have an application that can identify a window. The method in which I worked out is given below.
I will store the attributes of the window such as( class name, window caption, resource id etc..) to a file.
When the second time , window is up, using the above attributes, I will identify the window.
But, I encounter a problem with the above scenario. The problem comes, when the 'window does not have
window caption', 'window class name is same' and 'control id is zero'..
I can't use window handle, bcz it will differ when the window is up for the second time.
Is there any method to solve this problem? OR Is there any unique attribute to identify the window?
Please help,
Thanks in advance,
George K J
modified on Monday, September 22, 2008 4:22 AM
|
|
|
|
|
IMHO there is a logical pitfall in your requirements: processes and executable files are different things. For instance you may have three different instances of your_application.exe running at the same time, the system allows you to differenziate between these three processes, but such a distinction makes sense only at runtime.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In the VC++, when we create a control (such as button, static,...), the text on this control should be bold. what can we do to make it to normal???
|
|
|
|
|
I think you are working in Win32. Did you try SetFont(/*params*/)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
<br />
font.CreatePointFont (100,"Arial");<br />
<br />
RECT rect;<br />
rect.bottom = 100;<br />
rect.left = 0 ; <br />
rect.right =100;<br />
rect.top = 0;<br />
<br />
btn.Create ("MyButton",WS_CHILD|WS_VISIBLE,(const RECT &)rect,this,ID_BTN1);<br />
btn.SetFont(&font,false);<br />
font and button are both member variables of the class
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If you are using win32 API, then -
You can use CreateFont.
Be sure the handle returned by CreateFont ( which you will use for the WM_SETFONT message ) is valid throughout the lifetime of the button window.
If you want to make the font normal for all texts, then following may be helpful-
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
It may be helpful, but not sure......
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
nguyenbinh07 wrote: the text on this control should be bold.
What is it instead?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
nguyenbinh07 wrote: should be
Should be? YOU are responsible for setting the font
if you want something different
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
All
I have a problem in MFC SDI application.I Want to show a flash window before the SDI frame window is created.
Please help,
how to do this.
Tanmay
|
|
|
|
|
You mean a splash screen ? See here[^].
|
|
|
|
|
|
Have you searched CodeProject for articles on "Splash screen"?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
Hi,
Im having .inf and .sys file in my "C:\Program Files\Inno Setup 5" directory. I want to write the code for copy this file and paste it into "C:\WINDOWS\system32". I dont know, how to implement this.Plz...... help me.....
Regards,
Anitha
|
|
|
|
|
Did you try asking this question in any of the InnoSetup forums? You may get more help over there instead of trying to reframe the question and posting it here time and again.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hello all
I had written a small program to print ones compliment of zero in visual studio, and got the result as -1. I am surprised to see this result. because what I expect was ~0 = 11111111 !!!
Y it is -1 ?
Thank you
|
|
|
|
|
spicy_kid2000 wrote: ~0 = 11111111
Yes, in binary . You are probably storing the result in a signed variable (e.g. an integer or a char). And for a signed variable, if all bits are set, the resulting value is -1.
|
|
|
|
|
Hello , Thank you
in VC++ how can we print the right value ?
|
|
|
|
|
And what is, in your opinion, the right value?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
in my opitions, if it a unsigned int, it should be 2 ^32 -1
|
|
|
|
|
Then store the result in an unsigned int and display it. What's your code ?
|
|
|
|
|
here is my code
int main(int argc, char* argv[])
{
unsigned int i = 0;
printf("%d",~i);
return 0;
}
|
|
|
|
|
Use %u instead of %d. %d is for signed integers and %u is for unsigned integers.
|
|
|
|
|
The flawn is in %d format specifier. According to documentation [^] %d specifies 'signed decimal integer' hence you unsigned number is first converted to signed and the printed out.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|