|
when you first run a MDI app you have the empty space, the dark gray background. I'm wondering if it's possible to draw in that space. For example is it possible to paint it white and place text, perhaps a bitmap, or just paint it white period.
thanks!
|
|
|
|
|
Yep, sure can. The MainFrame (or CMDIFrameWnd) will have a m_wndClientArea variable. From that you can either subclass that window and do what you want, or create a sub-control to place onto it. I used the sub-control method to create a "start page" that had a MRU list and stuff that really wasn't a document.
--
Joel Lucsy
|
|
|
|
|
I guess I'm a little ignorant on implementing that solution. Do you have a sort of "sub-control for dummies" article on what you did? That is pretty much what I am looking for.
Thanks!
|
|
|
|
|
|
|
How do i go about adding a skin to windows? For example, make the window background and it's button controls have picture in them.
|
|
|
|
|
Search in codeproject there are about 10 skin examples with mfc and without...
Well... I am a beginner ...
|
|
|
|
|
You know how when you press the tab key on a window it goes through controls like buttons, radial buttons, and normal buttons in a certain sequence? Well, I have 3 edit boxes that I want to go in a certain sequence as I tab through them. How do I go about doing that?
Thank you in advance,
testtests
|
|
|
|
|
Under Resource Editor, press "Ctrl + D" to change the tab order.
Kuphryn
|
|
|
|
|
Thanks! that was easy
|
|
|
|
|
i'm starting to make a remote access control program, what should i need to learn to develope such program? any suggestions would be appreciated!
|
|
|
|
|
Kinda sounds like a RAT (Remote Administrations Tool) to me, if its anything like that then the first thing you need to learn is how to use sockets
|
|
|
|
|
I would like to know how to save BMP image from Clipboard to the disk
Michael Geffen
|
|
|
|
|
Hi!
You can use this. You can get the hdc by GetDC...
<br />
int Screenshotal(HDC hdc, char *pszflname)<br />
{<br />
HDC memdc;<br />
HANDLE hfl;<br />
DWORD dwBytes, dwWidth, dwHeight, dwNumColors, dwBPP, ColorSize;<br />
void *pBits;<br />
HBITMAP hbmp;<br />
BITMAPFILEHEADER fileheader;<br />
BITMAPINFOHEADER infoheader;<br />
RGBQUAD colors[256];<br />
BITMAPINFO bmpinfo;<br />
HGDIOBJ hret;<br />
<br />
dwWidth = GetDeviceCaps(hdc, HORZRES);<br />
dwHeight = GetDeviceCaps(hdc, VERTRES);<br />
dwBPP = GetDeviceCaps(hdc, BITSPIXEL);<br />
if (dwBPP <= 8)<br />
dwNumColors = 256;<br />
else<br />
dwNumColors = 0;<br />
if (!(memdc = CreateCompatibleDC(hdc)))<br />
return (0);<br />
bmpinfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);<br />
bmpinfo.bmiHeader.biWidth = dwWidth;<br />
bmpinfo.bmiHeader.biHeight = dwHeight;<br />
bmpinfo.bmiHeader.biPlanes = 1;<br />
bmpinfo.bmiHeader.biBitCount = (WORD)dwBPP;<br />
bmpinfo.bmiHeader.biCompression = BI_RGB;<br />
bmpinfo.bmiHeader.biSizeImage = 0;<br />
bmpinfo.bmiHeader.biXPelsPerMeter = 0;<br />
bmpinfo.bmiHeader.biYPelsPerMeter = 0;<br />
bmpinfo.bmiHeader.biClrUsed = dwNumColors;<br />
bmpinfo.bmiHeader.biClrImportant = dwNumColors;<br />
hbmp = CreateDIBSection(hdc, &bmpinfo, DIB_PAL_COLORS, &pBits, NULL, 0);<br />
if (!hbmp)<br />
{<br />
DeleteDC(memdc);<br />
return (0);<br />
}<br />
hret = SelectObject(memdc, hbmp);<br />
if (!hret || (hret == HGDI_ERROR))<br />
{<br />
DeleteDC(memdc);<br />
return (0);<br />
}<br />
if (!BitBlt(memdc, 0, 0, dwWidth, dwHeight, hdc, 0, 0, SRCCOPY))<br />
{<br />
DeleteDC(memdc);<br />
return (0);<br />
}<br />
if (dwNumColors)<br />
dwNumColors = GetDIBColorTable(memdc, 0, dwNumColors, colors);<br />
fileheader.bfType = 0x4D42;<br />
ColorSize = dwNumColors * sizeof(RGBQUAD);<br />
fileheader.bfSize = ((dwWidth*dwHeight*dwBPP) >> 3) + ColorSize + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);<br />
fileheader.bfReserved1 = fileheader.bfReserved2 = 0;<br />
fileheader.bfOffBits = ColorSize + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);<br />
infoheader.biSize = sizeof(BITMAPINFOHEADER);<br />
infoheader.biWidth = dwWidth;<br />
infoheader.biHeight = dwHeight;<br />
infoheader.biPlanes = 1;<br />
infoheader.biBitCount = (WORD)dwBPP;<br />
infoheader.biCompression = BI_RGB;<br />
infoheader.biSizeImage = infoheader.biClrImportant = 0;<br />
infoheader.biXPelsPerMeter = infoheader.biYPelsPerMeter = 0;<br />
infoheader.biClrUsed = dwNumColors;<br />
hfl = CreateFile(pszflname, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);<br />
if (hfl == INVALID_HANDLE_VALUE)<br />
{<br />
DeleteObject(hbmp);<br />
{<br />
DeleteDC(memdc);<br />
return (0);<br />
}<br />
}<br />
WriteFile(hfl, &fileheader, sizeof(BITMAPFILEHEADER), &dwBytes, 0);<br />
WriteFile(hfl, &infoheader, sizeof(BITMAPINFOHEADER), &dwBytes, 0);<br />
if (!dwNumColors)<br />
WriteFile(hfl, colors, ColorSize, &dwBytes, 0);<br />
ColorSize = (dwWidth * dwHeight * dwBPP) >> 3;<br />
WriteFile(hfl, pBits, ColorSize, &dwBytes, 0);<br />
CloseHandle(hfl);<br />
DeleteObject(hbmp);<br />
DeleteDC(memdc);<br />
return (1);<br />
}
Well... I am a beginner ...
|
|
|
|
|
;) ;)Dear Scolinks
I alredy used your code and it is works nice , thanks !!
|
|
|
|
|
"Avalon is the new Windows Desktop Composition Engine that replaces the old GDI and GDI+."
Is that totally impossible to replace GDI with an Avalon-like desktop compositing engine for older windows versions (name it: 2k/xp)?
What do you think? Won't Microsoft provide something like this before the release of longhorn?
|
|
|
|
|
mkristof wrote:
"Avalon is the new Windows Desktop Composition Engine that replaces the old GDI and GDI+."
Where did you get this from?
mkristof wrote:
Is that totally impossible to replace GDI with an Avalon-like desktop compositing engine for older windows versions (name it: 2k/xp)?
What does "that" mean in this context? I strongly doubt a third party (assuming Avalon is a 3rd party product), will ever be able to replace the GDI. This is a good thing.
mkristof wrote:
What do you think? Won't Microsoft provide something like this before the release of longhorn?
I think Microsoft is better off not providing this. Unless they have a really good stategy in place to tackle such an issue. Imagine the video card driver support each new vendor would need to provide. Its against the principle of providing a universal GDI in the first place.
Bikram Singh
|
|
|
|
|
bikram singh wrote:
Where did you get this from?
http://www.codeproject.com/scrapbook/PDC2003.asp
bikram singh wrote:
What does "that" mean in this context? I strongly doubt a third party (assuming Avalon is a 3rd party product), will ever be able to replace the GDI. This is a good thing.
"that" means nothing. It's my poor english... please read "that" as "it" (is it possible to replace GDI...?)
bikram singh wrote:
I think Microsoft is better off not providing this. Unless they have a really good stategy in place to tackle such an issue. Imagine the video card driver support each new vendor would need to provide. Its against the principle of providing a universal GDI in the first place.
I've read somewhere Apple's compositor engine for Mac OS X is "modern". There are no special hardware requirements for Mac OS X (except PPC is a totally different platform but there is no need to use special video cards with OS X). I know, Avalon will be more complex than the present engine for OS X but i think they should provide a new ("modern") compositor engine for latest Windows OS.
I just don't understand this situation. Microsoft Windows is the most popular desktop OS but it's interface is very obsolete.
|
|
|
|
|
for( unsigned int a = 0; a < strlen(message); a++ )
{
temp = VkKeyScan(message[a]);
if( GetKeyState( 20 ) && islower(message[a]) )
{
keybd_event( VK_SHIFT, NULL, 1, 0 );
keybd_event( temp, NULL, 1, 0 );
keybd_event( temp, NULL, 3, 0 );
keybd_event( VK_SHIFT, NULL, 3, 0 );
}
else if( !GetKeyState( 20 ) && isupper(message[a]) )
{
keybd_event( VK_SHIFT, NULL, 1, 0 );
keybd_event( temp, NULL, 1, 0 );
keybd_event( temp, NULL, 3, 0 );
keybd_event( VK_SHIFT, NULL, 3, 0 );
}
else
{
keybd_event( temp, NULL, 1, 0 );
keybd_event( temp, NULL, 3, 0 );
}
Sleep( 100 );
}
ok, i have solved the problem with Caps lock intefereing but i cant seem to keep shift from interfeering anyone know what i can do to keep it from interfeering?
|
|
|
|
|
Actually, no. But I checked the documentation for SendInput, which ought to have the same problem. I quote the following:
"Therefore, if the user has any keys pressed when you call this function, they might interfere with the events that this function generates. If you are concerned about possible interference, check the keyboard's state with the GetAsyncKeyState function and correct as necessary."
I did a quick test, but could not get rid of the spurious upper character - but you could at least experiment along those lines.
|
|
|
|
|
i just had an idea, i could disable the keyboard while the keys are being simulated when they're finished being simulated i could re-enable the keyboard
only one problem, i dont know how to disable the keyboard. and cant seem to find out how
|
|
|
|
|
I think that would be both hostile and massive overkill in a multitasking environment. A better idea would probably be to reset the key state as for SendInput . I suspect that a search on MSDN for GetAsyncKeyState and the other interesting functions ought to give some code samples that could be used.
|
|
|
|
|
Hi!
I'm currently making my first steps with Direct3D9.
I have a project running quite fine, I can render some triangles etc.
But after several executions of my program I get the following linker error when I want to compile:
DXProject fatal error LNK1201: error writing to program database 'e:\C++\DXProject\Release\DXProject.pdb'; check for insufficient disk space, invalid path, or insufficient privilege
what am I doing wrong? I need to restart my IDE in order to compile properly again.
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
It has been 2years since I wrote anything in c profesionaly...
so pardon the dry info..
the problem is that LINK could not write to the program database (PDB) for the output file.
Possible causes
File is corrupt. Delete the PDB file and relink.
Not enough disk space to write the file.
Drive is not available, possibly due to a network problem.
The debugger is active on the program you are trying to link
There is a limit of 4096 modules (.obj files) in a PDB file. The file also has a total size limit of approximately 64 MB.
RESOLUTION
There are several ways to reduce the size of PDB files:
Build some of the source files with the /Zd switch (line numbers only).
Build some of the source files as separate dynamic-link libraries (DLLs) instead of static libraries.
Build some of the source files without debug information.
Try the compiler switch /Fd"myproject.pdb" (including the quotation marks).
It is Illogical to define an inventor by his invention
|
|
|
|
|
Im making a key logger, and i want to give the user the option to keep it from showing up in CTRL+ALT+DEL menu
i have seen some VB examples that use an imported function from KERNEL32.DLL (RegisterServiceProcess)
can some one show how to use this in C++?
or possibly another way to hide it?
|
|
|
|
|