|
From MSDN:
DT_CALCRECT
Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
So it was me after all... my inability to read!! Sheesh.
Thanks!!
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
Heh, don't feel bad. It bites me every time I use that feature.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
There are 3-buttons or 'things-to-click' in the upper right corner
of a CFormView application. There is Minimize/Maximize, Restore and
Close. I have never touched any code related to those buttons for
years, but for some reason, they just don't work correctly now.
Is there an easy way to make those buttons work? Please let me know.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
How do they no work correctly?
Kuphryn
|
|
|
|
|
If I click the minimize button, it doesn't do anything.
If I click the Maximize/Restore button, I see a smaller button
indent and the program minimizes.
If I click the Exit/Close button, it closes.
|
|
|
|
|
You may have a handler for WM_SYSCOMMAND or WM_WINDOWPOSCHANGING which either doesn't pass down to DefWindowProc, or if it does, isn't doing it correctly.
When you hit minimize, you first get a WM_SYSCOMMAND with the SC_MINIMIZE code, then a WM_WINDOWPOSCHANGING which you can use to change some of the information before the change occurs.
You might also have overridden WM_NCHITTEST , which tells Windows what the user has hit when a mouse message occurs.
You should see whether the system menu still works properly - if it does, it's probably a problem with WM_NCHITTEST ; if not, probably either WM_SYSCOMMAND or WM_WINDOWPOSCHANGING
As always, the simplest way to see what's going on is to use Spy++, which should be in your start menu.
|
|
|
|
|
Well,
I am using CPropertySheet and adding CPropertyPage pages.
I have select the Tahoma font for all of the my pages including the parent CPropertySheet.
Now the problem is after setting the Font, I am still unable to view the dialogs with Tahoma font.
Can any body help me in this regard
The Phantom.
|
|
|
|
|
Post the code that sets the font for the property sheet and pages.
Kuphryn
|
|
|
|
|
I have set the Tahoma font with size 8 for every dialog in resource editor, rather then programatically.
This was the code:
CPropertySheet m_SettingPsh ; // dailog template in .rc
CPropertyPage m_PreferencesPpg ; // dialog template in .rc
m_SettingPsh.AddPage(&m_PreferencesPpg) ;
m_SettingPsh.AddPage(&m_PersonalPpg) ;
m_SettingPsh.AddPage(&m_ResponderPpg) ;
m_SettingPsh.AddPage(&m_ConnectionPpg) ;
But it still displays in the default font
The Phantom
|
|
|
|
|
One solution is SetFont(). Override OnInitDialog() and set the font for each dialog window.
Kuphryn
|
|
|
|
|
I got this BASIC code from an old book, I am converting this to c, could somebody tell me what is "On NTY GoTo 610, 620, 680, 690" function is? I know that is to go to line 610,620,680,690. but what are the conditions for that? how can I convert it.
what about " !" in here?, In c if it is "!=" that is not equal to, but what about here? It canot be factorial number.
NTY = ITYPE(I): KP = 4 * (I - 1) + 1
600 On NTY GoTo 610, 620, 680, 690
610 R = ELEM(KP): GoTo 660
620 REY = ELEM(KP + 1) * Abs(Q(I)): If REY < 1! Then REY = 1!
630 If REY < 2000 ! Then GoTo 640 Else GoTo 650
640 R = ELEM(KP) * 64 ! / REY: GoTo 660
650 R = ELEM(KP) * 1.325 / (Log(ELEM(KP + 2) + 5.74 / REY ^ 0.9)) ^ 2
660 DH = DH + S(J) * R * Q(I) * Abs(Q(I)) ^ EN
670 HDQ=HDQ+EX*R*ABS(Q(I))^EN GOTO 710
680 DH = DH + S(J) * ELEM(KP): GoTo 710
690 DH = DH - S(J) * E(LEM(KP) + Q(I) * (ELEM(KP + 1) + Q(I) * (ELEM(KP + 2) + Q(I) * ELEM(KP + 3))))
thanks in advance
shanila
|
|
|
|
|
shanila wrote:
600 On NTY GoTo 610, 620, 680, 690
if NTY is 1, then goto 610
if NTY is 2, then goto 620
if NTY is 3, then goto 680
if NTY is 4, then goto 690
shanila wrote:
630 If REY < 2000 ! Then GoTo 640 Else GoTo 650
Treats the previous number as a single-precision number, equivalent to a C float
Ryan "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"
|
|
|
|
|
Hello, how can I set the cursor behind the last character in a CRichEditCtrl. I tried to use SetCursor like in CEdit but doesn't work....
Thanx to all...
|
|
|
|
|
If you want to set the cursor after the last character then use CRichEditCtrl::SetSel(-1,-1);
If you want to set the cursor just before the last character in the control then use the following code;
CHARRANGE cr;<br />
m_wndRE.SetSel(-1,-1);<br />
m_wndRE.GetSel(cr);<br />
cr.cpMax--;<br />
cr.cpMin--;<br />
m_wndRE.SetSel(cr);
where m_wndRE is the control variable for the rich edit control.
Hope this helps.
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
Hi
Is there is any method to run a process without puting it in the process list (Ctrl+ Alt+ Del)
That mean I need to run a precess and I don't want the user to know about it!
Please Help
Thanks very much
|
|
|
|
|
bfadi wrote:
Is there is any method to run a process without puting it in the process list
No, not that I've ever come across. I can't think of a reason for doing this anyway.
Ryan "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"
|
|
|
|
|
Actually, I've seen an application (Invisible KeyLogger) which doesn't seem to show up on the task list. I've always wondered how it did it. There ought to be a way to modify the windows task list. Maybe not in the Win32 API's, maybe through direct access to the list memory.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
The only way I can think of getting around it is actually to use a device driver. For a keylogger, it would simply install a new keyboard driver that would transparently pass all the information to the previous driver, after logging it.
Again, why is it necessary to remove your process from the task list? Why do you not want the user to know it's running?
Ryan "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"
|
|
|
|
|
Hi,
I was just looking around, and I found this http://www.codeproject.com/useritems/PreventClose.asp[^]
I'd like to warn you, it's not the best written article i've read on CP
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Thats nice. I'm still wanting to know why he wants the app to not appear in task manager. I can't see any reason to do this, other than if it's a malicious app, which is why I'm not going to help yet.
Ryan "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"
|
|
|
|
|
I am creating an application in VC++ which can communicate with Internet Explorer.For eg:- I want my application to know which site is being accessed from Internet Explorer and control Internet Explorer through my application.I want to Know which MFC class to use for this purpose. I would be very thankful to any person who could help me in this matter.
|
|
|
|
|
One solution is COM via IWebBrowser2 ActiveX control.
Kuphryn
|
|
|
|
|
I found this project in the code project archives but I'm getting the error messages at the bottom. I was hoping someone might give me a hand getting this going. Am I missing a header or something? Thanks, Dave
<br />
<br />
<br />
<br />
#ifndef _MT <br />
#define _MT <br />
#endif <br />
<br />
#include "stdio.h" <br />
#include "windows.h" <br />
#include "process.h" <br />
#include "resource.h" <br />
<br />
bool bDone = false; <br />
<br />
void InputThreadProc( void *dummy ) <br />
{ <br />
HWNDhWnd = ::CreateDialog(NULL,<br />
MAKEINTRESOURCE(IDD_DIALOG),NULL,NULL); <br />
if ( hWnd!=NULL ) <br />
{ <br />
::ShowWindow(hWnd,SW_SHOW); <br />
} <br />
else <br />
{ <br />
printf("Failed to create dialog\n"); <br />
bDone = true; <br />
return; <br />
} <br />
MSG msg; <br />
while(1) <br />
{ <br />
if ( ::PeekMessage(&msg, hWnd, 0, 0, PM_REMOVE) ) <br />
{ <br />
if ( msg.message==WM_KEYUP ) <br />
{ <br />
int nVirtKey = (int) msg.wParam; <br />
if ( nVirtKey==VK_ESCAPE ) <br />
{ <br />
HWND hEdit = ::GetDlgItem(hWnd,IDC_EDIT); <br />
if ( hEdit ) <br />
{ <br />
char pText[3201]; <br />
int nSize = ::GetWindowText( hEdit, <br />
pText, 3200 ); <br />
pText[nSize] = 0; <br />
printf("\nYou have entered the "); <br />
printf("following text in a second ");<br />
printf("thread:\n\n%s\n\n",pText);<br />
} <br />
else <br />
{ <br />
printf("Failed to get edit control\n"); <br />
} <br />
::DestroyWindow(hWnd); <br />
bDone = true; <br />
break; <br />
} <br />
} <br />
::TranslateMessage(&msg); <br />
::DispatchMessage(&msg); <br />
} <br />
else <br />
{ <br />
::Sleep(100); <br />
} <br />
} <br />
} <br />
<br />
void main( int argc, char** argv ) <br />
{ <br />
printf("Hello, world of console apps\n"); <br />
if( _beginthread(InputThreadProc, 0, NULL )==-1) <br />
{ <br />
printf("Failed to create thread"); <br />
return; <br />
} <br />
while ( !bDone ) <br />
{ <br />
::Sleep(3000); <br />
printf("main thread running\n"); <br />
} <br />
} <br />
<br />
<br />
---------------------------------------------------------<br />
--------------------Configuration: console_window - Win32 Debug--------------------<br />
Compiling...<br />
console_window.cpp<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\console_window\console_window.cpp(20) : error C2065: 'HWNDhWnd' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\console_window\console_window.cpp(21) : error C2065: 'IDD_DIALOG' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\console_window\console_window.cpp(21) : error C2440: '=' : cannot convert from 'struct HWND__ *' to 'int'<br />
This conversion requires a reinterpret_cast, a C-style cast or function-style cast<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\console_window\console_window.cpp(22) : error C2065: 'hWnd' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\console_window\console_window.cpp(47) : error C2065: 'IDC_EDIT' : undeclared identifier<br />
Error executing cl.exe.<br />
<br />
console_window.exe - 5 error(s), 0 warning(s)<br />
<br />
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
In line 20, change HWNDhWnd to HWND hWnd .
IDD_DIALOG and IDC_EDIT should be defined in resource.h. You have created a dialog resource with those IDs have you not?
ps. why do people rate a question a 1? If the question is so dumb, and the answer so obvious, then answer the question or else totally ignore it and move on.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|