|
Maxwell Chen wrote: ROTFLMAO
What does that mean?
nave
|
|
|
|
|
Naveen R wrote: Maxwell Chen wrote:
ROTFLMAO
What does that mean?
Let me try...
Rolling On The Floor Laughing My Off
Nibu thomas
Software Developer
Faqs by Michael dunn
-- modified at 3:22 Tuesday 9th May, 2006
|
|
|
|
|
Nibu thomas wrote: ROTFLMAO
I thought it is "Rolling On The Floor Laughing My Off".
BTW, can anyone explain the syntax ?!
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: I thought it is "Rolling On The Floor Laughing My Off".
What are you talking about? :->
PS: Don't forget to quote the message next time;P
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Nibu thomas wrote: Don't forget to quote the message next time
Maxwell Chen
|
|
|
|
|
|
It looks like kind of recursive logic when we read back our posts to each others ...
Maxwell Chen
|
|
|
|
|
Hi,
I use an owner draw menu (handling WM_MEASUREITEM, WM_DRAWITEM, WM_MENUSELECT, WM_MENUCHAR messages).
Under MFC, if you use a popup menu with several menu items
(for example: recent files), two automatic menu scroll button appear on the top and the bottom of the list.
These buttons appear when there isn't enough place on the screen to display the menu items.
How can i change the default drawing of this buttons?
-- modified at 6:20 Tuesday 9th May, 2006
|
|
|
|
|
Hi, i have a text Box in my form.
mu aim is to force the user to type just numbers in that textBox.But i dont know how to do that.
So some plz could help me?
i Use the MFC.
thank you.
|
|
|
|
|
You can use the ES_NUMBER style when creating the control. If the IDE does not expose this style, edit the .rc manually and add it.
gmileka
|
|
|
|
|
georgeraafat wrote: If the IDE does not expose this style, edit the .rc manually and add it.
Wait, wouldn't the be #define in a header file?
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Yes - ES_NUMBER is defined in winuser.h. The .rc files can include headers.
gmileka
|
|
|
|
|
right click on the edit box->Take properties->Take Style tab->
In it u can find a check box labled Number-> Check it
nave
|
|
|
|
|
But by checking the box,we cannot include the decimal points...I have the same problem.
|
|
|
|
|
In that case derive a class from CEdit and overide the WM_CHAR message..
Inside that function u can prevent what ever characters u want(by not calling the CEdit::OnChar() from that function )
nave
|
|
|
|
|
CEdit m_Edit;
m_Edit.Create(ES_NUMBER|WS_CHILD|WS_VISIBLE|WS_BORDER,CRect(0,0,100,23),this,1);
m_Edit.SetWindowText("123");
----------------------------
m_Edit.ModifyStyle(0,ES_NUMBER);
or
change Number (ES_NUMBER) to true in window property form your Editbox
|
|
|
|
|
Hi,
I need to have a my C++ service detect keyboard clicks to perform certain actions.
I managed to create a dll to hook those events as described in: http://www.codeproject.com/win32/overrideparams.asp
BUT, it only detects clicks in the console session, not from a terminal session.
I even tried to enumerate all the windows stations and their desktops and run the InstallHook function on all of them... but no luck.
Any ideas ? I searched what seems to be the entire web... I'd appreciate any samples or pointers... seems like it should be fairly simple to do.
Thanks,
Ben
|
|
|
|
|
What type of hook did u put? WH_SHELL
Try putting a WH_KEYBOARD hook
nave
|
|
|
|
|
Yes, I put in a WH_KEYBOARD hook... but doesn't work if I'm in a TS session. (if I TS to the console session using mstsc.exe /console then it does work, but not in a normal TS session).
Code in DLL to install the hook is as follows:
hHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hInst, 0);
return (hHook != NULL);
I tried with both hHook being in a shared data segement and not...
In my C++ service, I call the code as follows (I also tried enumerating all the winstations and desktops and running InstallHook on all... but no luck):
/* -- Open user's window station "WinSta0". -- */
HWINSTA hWinStaUser = OpenWindowStation("WinSta0", FALSE, MAXIMUM_ALLOWED);
/* -- Set process window station to "WinSta0", this enables the process to
access objects in the window station such as desktops. -- */
if (SetProcessWindowStation(hWinStaUser)) {
/* -- Open user's desktop "Default". -- */
HDESK hDeskUser = OpenDesktop("Default", 0, FALSE, MAXIMUM_ALLOWED);
/* -- Set thread desktop to "Default". -- */
if (SetThreadDesktop(hDeskUser)) {
/* -- Now install hook procedure to monitor events associated
with threads in the user's desktop. -- */
InstallHook()
etc...
|
|
|
|
|
I found the solution, which was in some other part of my code, I need to call Default() to force the drawing of the "inside" before drawing the border.
I'm trying to draw a border around a CEdit derived control.
The CEdit has the "Vertical Scroll"
void CMyEdit::OnNcPaint()
{
Default();
CDC* pDC = GetParent()->GetDC();
CRect screenRect;
GetWindowRect( screenRect );
ScreenToClient( screenRect );
CRect newRect;
newRect = screenRect;
ClientToScreen( newRect );
GetParent()->ScreenToClient( newRect );
pDC->FrameRect( newRect, &m_BorderBrushFocus );
newRect.DeflateRect( 1, 1, 1, 1 );
pDC->FrameRect( newRect,&m_BorderBrushFocus );
}
When doing this, it draws the frame around the CEdit, but it hides the vertical scrollbar; when I start typing in the edit box, the "shape" of the scrollbar is visible, and if I add enough text to enable the scrollbar, it appears; but only if no repaint is necessary, then it will be erased.
Am I allowed to draw in such fashion ?
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
-- modified at 16:00 Monday 8th May, 2006
|
|
|
|
|
yes it hides the vertical scrollbar when type,but
can you tell please why use OnNcPaint instead WM_PAINT ?
|
|
|
|
|
I'm trying to put up a waitcursor before a possible lenghty operation (CSocket connect, if timeout occurs),but i'm unable to put it up. The waitcursor flashes real fast and returns to the standard
pointer, and after some debugging, it looks like the CSocket.connect function disengages
the wait cursor (as a test I removed csocket connect, and put a sleep in there and wait cursor stayed up for the duration).
I have tried different variations of putting up the wait cursor (CWaitCursor, beginwaitcursor, loadCursor) and at different parts of the code, to no avail.
Any help would be greatly appericated.
Thanks
|
|
|
|
|
Some other window has responded to the WM_SETCURSOR message. If you are doing this socket communication in a separate thread, a "wait" cursor is not required.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
If I set a breakpoint before I do my socket connect, and then continue my waitcursor shows up, if I run it w/o any breakpoints, no waitcursor!
Another weird thing is, the same function is called from another dialog, and the waitcursor shows up like it is supposed to.
|
|
|
|
|
All CWaitCursor does is call SetCursor() once. If your code ends up pumping messages and receives a WM_SETCURSOR which it does not handle, DefWindowProc() will set the cursor back to the cursor specified in the window class. It sounds like this is what's happening in your app. You'll need to handle WM_SETCURSOR and keep a flag saying whether you want the hourglass cursor, and set the cursor appropriately in your WM_SETCURSOR handler.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|