|
Download Device Drive Kit (DDK) from Microsoft[^] site.
A. Riazi
|
|
|
|
|
Hi, A. Riazi buddie!
I can not find the download page for DDK.
Can you point me the page?
Thanks in advance,
George
|
|
|
|
|
|
Thanks, Riazi buddie!
George
|
|
|
|
|
Hi, everyone!
I want to implement a mini-gateway on Windows platform.
Where can I get some sample codes for it? I need a gateway
that can implement basic functions, for example, check whether
a package from a certain IP address can pass through.
Thanks in advance,
George
|
|
|
|
|
I am using SetDialogBkColor to change the background color of our dialogs. Unfortunately CPropertySheet does not apply this setting. I have been able to change the property sheets background color via WM_CTRLCOLOR, but I can't seem to do this for the tab control embedded on the property sheet. I have tried subclassing the tab control, but I don't get WM_CTRLCOLOR messages for some reason. I have also tried overriding WM_DRAWITEM and WM_ERASEBGND with no success. Any ideas short of writing my own property sheet class? Thanks
Chris Hafey
|
|
|
|
|
hello,
i make a console application ,who give me the handel of one windows,and i want to use one API who use this handel given by the console application.Is that it is feasible?and how can to make it?
|
|
|
|
|
It's possible to use any Win32 API from console applications.
A. Riazi
|
|
|
|
|
Howdy'
I want to "replace" the 3d border around a CEdit with a simple rectangle ( that I can change color when the CEdit gets and looses the focus ).
How, Where (and maybe when), should I do this ?
I try overriding the WM_PAINT, but that doesn't go well,
void CCustomEdit::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetWindowRect( rect );
CBrush brush;
brush.CreateSolidBrush( RGB( 200, 0, 0 ) );
dc.FillRect( rect, &brush );
}
I was expecting to have at least a redish rectangle drawn somewhere, or at least a red flicker... but I only get a badly redrawn CEdit.
Thanks for you input!
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
You can draw your own border by handling the WM_NCPAINT message. WM_PAINT is used for the client area.
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!
|
|
|
|
|
It doens't work ...
This is what I do :
void CCustomEdit::OnNcPaint()
{
CRect rect;
GetWindowRect( rect );
CDC* pDC = this->GetDC();
rect.InflateRect( 10, 10 );
CBrush* pOldBrush =pDC->SelectObject( &m_Brush );
pDC->FillRect( rect, &m_Brush );
pDC->SelectObject( pOldBrush );
CEdit::OnNcPaint();
}
I think, this should fill a rectangle around the edit box.
Thanks again for your input.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Try using GetWindowDC() instead of GetDC(). also, do not call CEdit::OnNCPaint() because that will simply cause the OS to draw over any drawing you have just done. also, (part two) be sure to call ReleaseDC().
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!
|
|
|
|
|
I think it's working, I now get something drawn!
But now I have to get the correct coordinates, client vs. window vs. screen ...
Thanks!
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Override OnChildNotify() in the CCustomEdit. In this function check if the message is WM_CTLCOLOREDIT. If so, then uset SetbkColor function to set the background color. The WPARM value will be the handle to DC.
|
|
|
|
|
I have no problem with changing the background color, I just override the CtlColor for the CEdit ( with ON_WM_CTLCOLOR_REFLECT )
but I still have problem with other painting for the CEdit.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I am almost done with a beta version of an MFC appln. Now, however, I realize that when I created the appln with AppWizard I forgot to check the 'Text Sensitive Help' option. How do I go about in including that feature? I've created the help files, compiled them, but do not know how to add the feature to my appln. There must be a way! On a similar note, how would I switch from SDI to MDI? Is that possible to do after creating your programs? Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Hi all. Does it ever end? man. issue after issue I'll tell ya. ugh. Anyways, I have a problem performing the following:
if ((lResult = RegCreateKeyEx(HKEY_CURRENT_USER,"AppEvents\\Schemes\\Apps\\.Default\\.Default",
0,"",REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,
&hKeyResult,&dwDisposition)) != ERROR_SUCCESS)
printf("Failed\n");
if((lResult = RegSaveKey(hKeyResult,"reg.tmp",NULL)) != ERROR_SUCCESS){
printf("Failed\n");
}
The problem is I get the Key back properly, but when I try to save the Key so I can modify and set it back later on, I keep getting an error. The file does not exist when the error is returned. And I can't seem to find a simple way to get the error being returned
Any suggestions?? Thanks!
Dan Willis
|
|
|
|
|
Could you check the return value from RegSaveKey? It might give you a clue.
|
|
|
|
|
AlexO wrote:
Could you check the return value from RegSaveKey? It might give you a clue.
Just what I was going to suggest. Not sure about the ".Default" entries, but I assume they are kosher.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Yeah,
The error coming back is a 1314 system error, otherwise seen as:
"A required privilege is not held by the client. ERROR_PRIVILEGE_NOT_HELD "
I finally realized that after wards.
But that doesn't make any sense to me becuase I can still delete the registry key. How is it possible that I have privileges to delete it but not to save it?? makes no sense...
thanks guys.
Alex O, maybe I should just hire you. LOL you've helped me countless times.
Thanks
|
|
|
|
|
will1383 wrote:
ERROR_PRIVILEGE_NOT_HELD
That makes sense in light of this note in the docs:Windows NT/2000/XP: The calling process must have the SE_BACKUP_NAME privilege enabled. For more information about privileges, see Privileges. Follow the Privileges link in your documentation for a description of how to enable that priv.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt - file encryption w/Explorer plugins | 1ClickPicGrabber - web page picture grabber for IE
My IntarWeb Homepgae!!!11
|
|
|
|
|
I have just a couple questions here... hopefully someone here can help me out.
1) I started a win32 API project, and saved my code in a *.c file, then I realized that I wanted to make use of some c++ stuff (objects), so I changed the name to *.cpp. Then, the next time I compiled the code, the following line started giving an error in the WM_PAINT section.
HBITMAP g_hbmDisplay = NULL;
HDC hdcMem2 = CreateCompatibleDC(hdc);
HBITMAP hbmOld = SelectObject(hdcMem, g_hbmBall); saying that "cannot convert a void * to struct HBITMAP__ *", even though, as a *.C file it worked perfectly.
2) Is it possible to have a *.c file and a *.cpp file in the same project and have the both of them work together, or is it a one or the other sort of deal?
3) What are the differences between windows programming in C vs C++ as far as the API is concerned? I dont need a very detailed exlanation, just a gist of what the differences are would suffice.
Thanks... I realize that it is probably annoying answering these questions, so if there is a recommended book on API programming in windows C++ that would also be appreciated.
|
|
|
|
|
SumGuy wrote:
cannot convert a void * to struct HBITMAP
just cast the result to HBITMAP : foo = (HBITMAP)SelectObject..
When history comes, it always takes you by surprise.
|
|
|
|
|
OMG, I can't believe that I didn`t think of trying that... I was always trying put the (HBITMAP) in the second parameter of the SelectObject(hdc, (HBITMAP) blah); If I would haver thought of that one, I could have went without wasting space on this forum...
thanks a lot, that's one less headache.
|
|
|
|
|
Re: #2 and #3
2.) Sure, you can have both 'c' and 'cpp' files in the same project. The linker only complains when you use a C-compiled function inside a C++ chunk of code. In that case you could use extern "C" {} wrapper in the C++ code.
3.) C programming for windows typically involves the Windows SDK without any wrappers to hide its complexity. There is no inheritance hiearchy to worry about so its easier to understand when you don't know object-oriented programming (OOP) so well.
C++ programming for windows involves understanding the inheritence mechanism and that, for instance, in MFC, a CDialog has its member functions *plus* the CWnd member functions and so on.
In general, C++ makes the implementation of a GUI a bit more compact and understandable with the condition that the person reading the code has OOP knowledge.
Yo, peace out!
|
|
|
|