|
How do you know? I don't. Just thought I'd throw that out there.
Mark Salsbery
Microsoft MVP - Visual C++
"Thanks,I overlooked the docs."
|
|
|
|
|
I want to use GetOPenFileName() to allow the user to select one or more files.
I have a problem in the case of multiple selection:
HOW CAN I KNOW THE EXACT NUMBER OF SELECTED FILES?
VC++6 please...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
YOU SCAN THE DATA IN THE lpstrFile BUFFER COUNTING NUL CHARACTERS UNTIL THE TERMINATING DOUBLE-NUL S THAT INDICATE THE END OF THE LIST.
Oh, and please DO NOT SHOUT ...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: Oh, and please DO NOT SHOUT...
I actually think he was emphasizing rather than shouting.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Semantics... Then I was emphasizing as well...
Although you might be right - I am a bit on edge today...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Some forums don't allow HTML as part of the post so folks get used to capitalizing words or surrounding them with asterisks. He may have just been laying all the prerequisites out at the beginning, and then setting the question apart by capitalizing it.
In any case, I hope your day gets better.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks! I was thinking to a similar method, but I was expecting a strait method.
Thanks, again
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Shouting is about GLOBAL WARMING?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hi all,
I'm not sure if this is the right place to post this question, but I have a problem in C++ app i'm developing. I have developed a little tool that reveals hidden passwords in CEdit (EDIT class) objects, but now I need to extract passwords that have been filled in in web pages in boxes. Does anyone know how to do this? I was hoping that Spy++ would show me that Firefox/Explorer renders these controls by inserting EDIT class objects as windows, but it doesn't seem to do this...
This has been bugging me for ages- any ideas anyone?
Thanks in advance!
|
|
|
|
|
I believe that little feature was fixed in one of the XP service packs, and I believe that modern browsers use RichEdit or similar controls (hence the ability to drag-n-drop text with them).
Cannot help you with an easy way to do it - the only way I can think of is to hook into the process and get the text directy (WM_GETTEXT ) or get access to the internal buffer(s) used by the edit control and extract the text from there.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
So the browser IS actually creating a rich edit control? If so that's good news because I have a dll I can inject into the process to acquire the password, this lets me skip over XPs new security updates. What I need now is some way of getting the HWND of an edit control in a webpage- when I look at the page with spy++, I just see one window for the entire page- no children!
any ideas?
|
|
|
|
|
It is possible that the page being rendered is not placing/positioning real controls on the client area, but simply drawing onto it using off-screen controls, similar to how you print something. If they are using real controls (which I think that they are), you should be able to figure out the HWND of the parent/container and then enumerate windows looking for password-styled controls.
Other than that, no ideas...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hai All,
I'm creating an onscreen keyboard.In that I'm using the techinique of changing the focus from the keyboard window to the last focused window after the mouse click on the keyboard window and then sending the input using the keybd_event().
It is working good with notepad.
My problems are
1.It is not working with WordPad.
2.the oter problem is that if I'm having a password dialog created in MFC and while I'm trying to enter the password using the keyboard window,only thye current key entered is shown.the earlier one if exits is replaced.So I tried to store the last cursor postion and retrive it to set as soon as the password window getthe focus(ie,after the keybord windows button is pressed).But I'm not able to set the cursor to the previous postion of password dialog.
Please tell me some way to fix it.Or if my logic is inadiquate please refer me some suggestions or links to do that.When I checked the default Onscreen Keyboard supplied by "Windows" and it works really good.
Please tell me some way to proceed.
Thanks and regards
Robs Here
|
|
|
|
|
I'd recommend never letting your on screen keyboard take the focus in the first place, have it behave as a persistent ontop popup. I've only done keyboard replacement stuff on WinCE where things are a little different but in that case you register your Software Input Panel as a special kind of control and Windows loads it and displays it for you. I guess there is probably something similar on whatever version of windows you're using and you should probably go that way to get it to behave properly. Also you need to insert your key presses into the keyboard chain as if you were operating a real keyboard, keybd_event() may or may not be right for this, otherwise IME keyboard handling and other stuff that might be in the keyboard chain like global hotkeys will not work. I'd check the documentation for Text Services Framework as a reasonable place to start.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I use these code for register my dll.
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
<br />
ZeroMemory(&si, sizeof(si));<br />
si.cb = sizeof(STARTUPINFO);<br />
si.dwFlags = STARTF_USESHOWWINDOW;<br />
si.wShowWindow = SW_SHOW;<br />
ZeroMemory(&pi, sizeof(pi));<br />
sprintf(pszCmdLine, "regsvr32.exe \"%s\"", m_COMPath);<br />
if(CreateProcess(0, pszCmdLine, 0, 0, FALSE, CREATE_DEFAULT_ERROR_MODE | NORMAL_PRIORITY_CLASS, 0, 0, &si, &pi))<br />
{<br />
CloseHandle(pi.hProcess);<br />
CloseHandle(pi.hThread);<br />
}
It work fine and every time I register it will pop up message box from regsvr32.exe that tell about the registration successful.
But my I don't want to show this message in my program.
How can I avoid this message box?
|
|
|
|
|
I just checked the help of regsvr32 but I never tried this myself.
I think if you pass "/s" as a commandline parameter to regsvr32, it will no display the msg box (silent mode). Just try it and tell me if that works, I would be interested.
|
|
|
|
|
You are correct - the usage is:
Usage: regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname
/u - Unregister server
/s - Silent; display no message boxes
/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall
/n - do not call DllRegisterServer; this option must be used with /i Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
every thing work fine
Thanks a lot.
|
|
|
|
|
You can take the help on command on command prompt by typing the command followed by "/?".
eg. dir /?
Regards,
Paresh.
|
|
|
|
|
Is this legal:
char *text;
text="";
text="hello";
It's been a long time since i had to do with strings... (no alternative wanted, this is pure C without any libs)
|
|
|
|
|
It's legal. text first points to an empty string, and then to a "hello".
Just don't attempt to change the string that text is pointing to
|
|
|
|
|
IMHO, it is kinda legal - constant strings usually use constant memory, but you are assigning them to a non-const pointer.
That code will compile on lots of compilers, if that means "legal" to you.
Remember that a pointer and an array are two different things - a pointer points to a location in memory (which may or may not be valid), while an array IS a valid location in memory.
Since your pointer is not set up (initially) to point to any valid memory, you could not strcpy(...) into it without risking a crash or other problems.
char *text;
text="";
text="hello";
char *text;
strcpy( text, "some string" );
char textarray[ 64 ];
char *text = textarray;
strcpy( text, "some string" );
strcpy( textarray, "another string" ); Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Oh yes, that's it. Thanks James.
|
|
|
|
|
Related topic! Ofcourse another "root"
James, Imagine I'm initializing a char-string array statically like :
char chArray[MAX_LEN][MAX_LEN]={"ONE","TWO","THREE".....};
This being declared/defined globally makes no issues. Now I want this be wrapped up inside a class. and still wanting to do it in a single line. like the above. You cannot certainly init it inside a class' declaration.
and if you take this to the constructor, you would lose the declaration(data memeber!) inside the class. so how to go? Should I use refs inside the constructor?
|
|
|
|