|
Try handling the WM_SETFOCUS/WM_KILLFOCUS messages and draw/erase the focus rect yourself (don't call the base).
|
|
|
|
|
I'd recommend creating an owner-draw control. Windows won't draw anything for an owner-draw control, and delegate everything to your control.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
try taking a look at the classes present here in CP, my favourite is the one from Davide Calabro CButtonST, it has a lot of properties and it's great to learn how to manage things like what you want to do...
hope this helps...
|
|
|
|
|
easy
in WM_ERASEBACKGROUND, return 0
includeh10
|
|
|
|
|
Dear all,
This may seem like a strange question but I am working with some old 16 bit windows applications build with Visual Studie 1.52.
I was wondering if there are any way to force this application to have more process time from the OS?
Best regards
Michael Nyrup
|
|
|
|
|
Nyrup wrote:
I am working with some old 16 bit windows applications build with Visual Studie 1.52
You poor thing
Nyrup wrote:
I was wondering if there are any way to force this application to have more process time from the OS?
Windows 3.x uses cooperative multitasking, not preemptive multitasking like Win95 and later. If you just hog the processor, you cut out other processes.
From memory (admittedly, my Windows 3.x memory is a little bit rusty ), Windows only switches between processes when a process calls the Yield() or GetMessage() functions. If you call them less often, then you get more processor time, at the expense of other processes.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
The 16-bit app runs in a 32-bit VDM process, so you can do the following:
Right click the app's pif and set the Idle sensitivity to low.
-or-
Boost the priority of the VDM process.
|
|
|
|
|
I necessary to do window, which there was inactive and always inhere over all windows (even over DirectX)
|
|
|
|
|
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
Jeremy Falcon
|
|
|
|
|
I necessary that window there was over DirectX, for instance over game and in game possible there was orderly play.
|
|
|
|
|
|
Yes. Look at the AlphaBlend() function.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
... the middle button of my mouse in a dialog MFC app ? Is there any message associated to it (like WM_LBUTTONDOWN f.i.) ?
~RaGE();
|
|
|
|
|
i really could not get the question !
___________________________
When a thing is new, people say, "It's not true." Later, when its truth becomes obvious, people say, "It's not important." Finally, when its importance cannot be denied, people say, "Well, it's not new."
|
|
|
|
|
|
Sometimes I really wonder how i search in my MSDN ... Sorry and thanks !
~RaGE();
|
|
|
|
|
Hi:
Ok guys let me narrate the prob:
i've installed a windows hook monitoring some system events ,infact i am capturing the keb-keys,arrival of each message is followed by some writing of values in a text file .the writing of this key event was done in the
KeyboardProc()
present in the dll,but this did'nt work well because obviously i had to call the next hook in the chain as soon as possible but i was doing some file processing...
the result of this was that when i typed the keyboard-keys quickly ,i found that the file has not recorded the exact sequence of the keys, rather some keys were swaped ...for example
when i typed
"my name is ahmed"
i received something like this in the file
"my anme si ......"
this behavior is seen when i type quickly
i tried an alternative using Critical section in key keboardproc but this could not work also ,perhaps we can't block the system who calls the KeyboardProc().....
/************************************************/
ok guys i've changed my approach now but still some problems are there as explained below
now i am simply Posting the character(key) received in the keyboardproc() to a thread in a seperate process and calling the next hook imidiately as shown below
... KeboardProc(.........)
{
..............................................
/*hThread is the handle of the window associated with a thread in a seperate process*/
//imediately return after posting unlike SendMessage()
PostMessage(hThread,...,...,..);
return CallNextHook(..);
}
/***********************************************/
Message loop in the thread that is receiving messages from hook
while( GetMessage( &msg, NULL, 0, 0 ))
{
1: TranslateMessage(&msg);
2: AfxMessageBox(" key notification ");
//DispatchMessage(&msg);
}
My target is that the next key in the message que is not extracted from the que untill the previous has been processed..
Problem:
the problem here is that when i press a key i get an AfxMessageBox() as desired in the message loop , now when i press the second key without dismissing the "AfxMessageBox" that was showed for the first key,a new "AfxMessageBox" box appears and this keeps happening as long as i keep pressing keys so message window keep on increasing why is this happening.....?
Because the rule says if do not dimiss a messagebox the control should not go to the next statement.. so why the next message is processes while the previous message is still not completely processed
1: while( GetMessage( &msg, NULL, 0, 0 ))
{
2 TranslateMessage(&msg);
3 AfxMessageBox(" key notification ");
//DispatchMessage(&msg);
}
why the control goes to line 1 althogh the function on line 2 has not returned?..........................i dont want this to happen i used critical sections in the thread also but to no avail.........
ahmed
|
|
|
|
|
Hi all,
I've got some files from our source control system, these are .c, .h, .Mak, and a MAKEFILE, and they compile to make a program.
My problem is I'd like to put them into a workspace and project, but am stuck on how to do this. Do I create the workspace then create a blank win32 console project, add the files in, and compile that way? I did this, but I get errors (I know the code works) concerning near and far keywords in the files, so I think I need to build according to the MAKEFILE but am unsure as to how to tell visual c++ to do this.
Any thoughts? I hope this is clear enough!
Obseve everything, remember more...
|
|
|
|
|
From the File menu, select Open Workspace. Look for files of type *.mak.
|
|
|
|
|
|
You could extract the highest significant bit of your integer, then just shift it left. But I'm not too sure how faster it would really be than using the well known log() and pow() fonctions.
|
|
|
|
|
Try :
unsigned long RoundUpPow2( unsigned long x )
{
x = x - 1;
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >>16);
return( x + 1 );
}
for x >= 2
...cmk
|
|
|
|
|
Can any one tell me that what is the meaning of real data type. I've seen and heard this term "real data type" many times specially in COM where certain constructs are common like RT_8, RT_16 e.t.c.
So what is a real data type? Is it a signed data type or not. What is it ?
|
|
|
|
|
The data types that are supported by the system/language directly are called as real DT. Like in C/C++ 'int' and 'float' etc are real data types (i.e directly supported by compiler/system). on the other hand there are adstract or user defined data types such as structures/classes.
I hope this explains ur query...
___________________________
"Think big, think fast, think ahead. Ideas are no one's monopoly"
|
|
|
|
|
Data types commonly referred to as real are basically the language's way of saying it is a floating point number.
I think the term real comes from the mathematical classification of numbers:
- Natural Numbers: 1,2,3,4,..
- Whole Numbers: 0,1,2,3,4..
- Integers: -2,-1,0,1,2,3,..
- Real: 3.4, 1.0, 2.0, -5.664, 3.142
- Complex Numbers: 5+3i
So the real data type can be used to represents numbers that can be whole (3,5,6) or a fraction of a number (2.1, 5.6, 1.333..).
In C++, real data type can be defined as a float, or a double variable. Double uses a higher level of precision than a float value.
COM Objects represents real values using the VARIANT type of
VT_R4 (float) or VT_R8 (double). VT_R4, RT_4 and float are just language specific ways of representing the same number, just expressed differently.
I'm sure there are more detailed explaination on data types on this topic, but I just wanted to give a general view, without going into to much details and specifics. Maywell be that Its not as accurate, but you should get the idea.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|