|
Write this in OnInitDialog to show it as maximized.
this->ShowWindow(SW_MAXIMIZE);
To handle redrawing functionality you will have to write your code in OnPaint.
Einstein: "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
My Articles
|
|
|
|
|
thx...btw where I can get some examples of redrawing functionality, because I am a newbie...
thx..
|
|
|
|
|
Hi all
I want to know some system information like Sound Card, Video card, Network Card and Peripherals like Printers,infrared, Scanners etc.
Thanks and Regards
|
|
|
|
|
Maybe this API's EnumDevices / EnumPrinters might help.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
You can retrieve such information from REGEDIT , using CRegKey class.
I do not exactly remember where they are stored but if you search in google it will definitely help you.
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
|
Reference the following code in C++ using Registry API methods
HKEY hKey;
DWORD n, RtnCode, RtnCode1;
char valName[256];
DWORD valNameBuf = 256;
char valData[256];
DWORD valDataBuf = 256;
bool bMatch=false;
for(n = 0, RtnCode = ERROR_SUCCESS; n
|
|
|
|
|
memset is what you need. As in memset(&valData[0], 0, 256);. You should also fix the rest of your code, unless you're actually programming in C. Putting all the variables at the top makes your code harder to read, and creating any variables without giving them default values is a recipe for bugs due to uninitialised values.
Also, your code is not displaying properly because you didn't check 'Do not treat <'s as HTML tags'.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, all:
I am using VS6 SP5 on Win2000 Pro SP4. I have a relative big project (~ 370 *.h and *.cpp files, plus resource files). I try to import about 50 bitmaps ( 32X32 256 color ) into resource view. I can import about 30 or so, then the imported image become empty bitmap in the Resource Editor. If I delete some of the bitmaps, then I can import those I failed to import before. Sometimes after importing 20+, if I click on Save All, or Build button, Visual Studio crashs.
When I try to edit the source files (*.h or *.cpp), I find that frequently the studio editor seems hang up for a few seconds. The cursor or mouse react very slowly, a few seconds dely. I guess it is related.
I do have pretty powerful machine ( more then 1GB RAM ).
Is this MS Visual Studio bug? I am stuck and if you can shed any lights on this, I really appreciate. Thanks in advance.
Dion
|
|
|
|
|
I am currently working on a project with 70+ bitmaps...most are 15k bitmaps with ard 5 of 1000-2000kb bitmaps. My program is still working find...abit slow in certain situations....i think its because mfc isnt suppose to be a good graphic processor. If you need one, thats where direct x comes in.
just my 2 cents.
Aaron
|
|
|
|
|
Anonymous wrote:
....i think its because mfc isnt suppose to be a good graphic processor. If you need one, thats where direct x comes in.
That's not true. Photoshop does not use DX, neither should you if you just have a handful of tiny bitmaps floating around. If it's slow, you need to look at your code to figure out why.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Do you have all those windows open at the same time?
How much RAM is on your video card?
Possibly you are running out of video RAM for some reason.
If your video card is using 'shared' memory, then maybe you can increase the amount of RAM that the video driver will use?
|
|
|
|
|
|
Anyone come across this problem where some of the afx_msg get execute twice?
afx_msg like onButton1 get call twice...and AfxMessageBox("here"); also get execute twice....anyone know wats the problem?
Aaron
"To start a war takes the word "fight", To end it takes a whole lot more explanation"-- someone
|
|
|
|
|
Try posting some code.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
This should be easy. All i want to do is have some text highlighted in a control in another window. The control doesn't respond to any EM_* messages so i'm simulating the selection of text by sending a series of VK_RIGHT and VK_SHIFT key presses.
The problem is that it the 'right arrow' key gets pressed but the control doesn't have the effect of the 'shift' key. I know it gets pressed because once i move around in the control, the shift key is still down (when i uncomment the shift release key press - see last line of below method)!!
I have to do it this way as i have no other choice.
Here's the code:
window->BringWindowToTop();
//THIS PART WORKS
//Same effect as pressing the right arrow key 10 times
for (int a = 0; a < 10; a++){
wnd->SendMessage(WM_KEYDOWN, VK_RIGHT, 0);
wnd->SendMessage(WM_KEYUP, VK_RIGHT, 0);
}
//This part should select the next 5 characters of text.
//Simulates holding down shift and pressing 'Right Arrow' key 5 times
INPUT input[2];
for (int b = 0; b < 5; b++){
input[0] = GetKeyboardInput(VK_LSHIFT, 0);
input[1] = GetKeyboardInput(VK_RIGHT, 0);
//Press down shift and right arrow key
SendInput(2, input, sizeof(INPUT));
input[1] = GetKeyboardInput(VK_RIGHT, 2);
//Release right arrow key
SendInput(2, input, sizeof(INPUT));
}
//Release the shift key
input[0] = GetKeyboardInput(VK_LSHIFT, 2);
SendInput(2, input, sizeof(INPUT));
INPUT CFindInWindowDlg::GetKeyboardInput(short key, int downUp)
{
INPUT input;
input.type = 0x01; //INPUT_KEYBOARD
input.ki.dwExtraInfo = 0;
input.ki.time = 0;
input.ki.wScan = 0;
input.ki.wVk = key;
input.ki.dwFlags = downUp;
return input;
}
Any help would be greatly appreciated. My head is going to explode!
|
|
|
|
|
c121hains wrote:
The problem is that it the 'right arrow' key gets pressed but the control doesn't have the effect of the 'shift' key. I know it gets pressed because once i move around in the control, the shift key is still down (when i uncomment the shift release key press - see last line of below method)!!
Try the following. I tested it with an edit control in the same dialog and it worked... May or may not work in your case, but I hope you'll let us know
static INPUT GetKeyboardInput(short key, DWORD dwFlags)
{
INPUT input;
input.type = INPUT_KEYBOARD;
input.ki.dwExtraInfo = 0;
input.ki.time = 0;
input.ki.wScan = 0;
input.ki.wVk = key;
input.ki.dwFlags = dwFlags;
return input;
}
void CFindInWindowDlg::Select(CWnd* window, int start, int count)
{
window->BringWindowToTop();
INPUT input[4];
input[0] = GetKeyboardInput(VK_SHIFT, KEYEVENTF_EXTENDEDKEY);
input[1] = GetKeyboardInput(VK_SHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY);
input[2] = GetKeyboardInput(VK_RIGHT, 0);
input[3] = GetKeyboardInput(VK_RIGHT, KEYEVENTF_KEYUP);
for (int i = 1; i < start; i++)
{
SendInput(2, &input[2], sizeof(INPUT));
}
SendInput(1, &input[0], sizeof(INPUT));
for (int j = 0; j < count; j++)
{
SendInput(2, &input[2], sizeof(INPUT));
}
SendInput(1, &input[1], sizeof(INPUT));
}
I think your problem was:
1. Not using KEYEVENTF_EXTENDEDKEY for the shift key.
2. Sending too many shift keys (where you say "release the right key" you were actually sending [shift down + right up], and after the loop you were sending [shift up + right up]).
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
EXCELLENT! It works... it's alive!!!!!!!!!
hehehe
Thanks a million!
|
|
|
|
|
this is very important (fatal) for me. I think you can help me.
I need code of a Scentefic Calculator with C++ or VC++ or c#
that can draw functions like (y=sin(x)) and so on.
If you can give me an address or guidance.
Thank you very much again and again.
TA RedStar
|
|
|
|
|
You want to draw the functions onto a bitmap ? Well, the most obvious solution would be to read up on GDI+ if you have VC.NET, otherwise on GDI. You need to create a bitmap, then you can use GDI functions, or just SetPixel to draw the points of your function. The math library header will give you access to trig functionality, etc.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why do you need the source? Did you start late on a school project of yours and now you need it finished by the end of next week or you'll fail your course?
If that's the case you can look here[^] for a calculator, but you have to do the drawing yourself.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
> this is very important (fatal) for me
No[^] it's not. I'm pretty sure of it.
|
|
|
|
|
Dear all,
I'm building a Context Menu Extension. When user clicks on my extension, say, "My extension," I call a function in my DLL and show a dialog. How to apply XP Theme to this dialog's controls? I tried adding the RT_MANIFEST but it didn't work.
However, when I write another testing app from which I call that DLL's function to show the dialog, it works properly.
So, the question here is how to apply the XP Theme to a DLL called from a context menu extension.
Best regards,
|
|
|
|
|
I need to access the internet using MFC program from LAN that connected to ISA server proxy.
I need to gamp over this server using my MFC program .
can any one help me about this problem.
plz, some source code....
thanx in advance.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
GetWindowText() will give you the text from a textbox.
Christian Graus - Microsoft MVP - C++
|
|
|
|