Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

andreir23

@andreir23
About
Posts
16
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • newbie question of the day: How do you retrieve your app's HWND handle?
    A andreir23

    I have a small dialog-based app made with MFC AppWizard. In the dialog class I do some stuff and need to have handle for the window (dialog window). I use ::SetTimer and ::KillTimer and they require the handle (HWND type not CWnd type!) of the app. BTW.. Is there any example of how to use SetWaitableTimer? TIA!

    C / C++ / MFC tutorial question c++

  • Sendkeys in MFC?
    A andreir23

    Here's how I did it. I had a window "PCTV Vision" that I had to send ALT-R. I used a tool simillar to Spy++, it comes with Borland Delphi 3 and it is called Winsight32. With WInsight I selected that window and I started logging all the messages that went to that window. Then I made it active and pressed ALT-R from the keyboard. I returned to WInsight32 and looked in the message log. I found there a WM_COMMAND which he recognized as "Accelerator". I shamelessly copied the WParam and Lparam and pasted it in my program which sounds like PostMessage(hwnd,WM_COMMAND,stolen_WPARAM,stolen_LPARAM); The good part is that it works!!! ;-) :-) I never tried Spy++ because I haven't installed Visual Studio Completely and it isn't installed.

    C / C++ / MFC c++ help question

  • newbie thing: Reading command line arguments in an MFC dialog-based App
    A andreir23

    I realize this sounds idiot, but how do you ?? I can't find any main() or wmain() function in my project and can't acces any argc or argv. I tried to acces them anyway but they are undefined. Searching through the SDK I only found 2 functions: GetCommandLine(); CommandLineToArgvW First one seems to work but the second I couldn't convince to work. And I surely tried. Simply hates me. Does anyone have any ideea, HOW CAN I READ THE COMMAND LINE ARGUMENTS IN AN ARRAY OR SOMETHING SIMILAR TO ARGC AND ARGV? TIA!! ;-)

    C / C++ / MFC question c++ algorithms data-structures

  • How can I send a certain key to a certain application? (simulate keyboard)
    A andreir23

    I have a TV tuner with a crappy app that controls it and no scheduler to record shows. I would write my own app to schedule the startup of the crappy app and the ALT-R to begin record and again to stop it. Unfortunately all I know is that I have to send the app a certain message. Any clues guys? :-) Thank you, Andrei. LATER UPDATE: So I found you can use: PostMessage(hwnd, WM_CHAR, WPARAM('^'), LPARAM(M)); for CTRL-M But there appears 2 more questions in my mind: a) How do you do it for ALT-R or ALT-F4? Any general rule? b) How do you determine the handle of the window you want to send it to? Mine has "PCTV Vision" in the title. Any chance you have to use FindWindow? TNX!

    C / C++ / MFC question announcement lounge

  • How do you modify a string from a string table and/or how you use it ?
    A andreir23

    Thank you! Seems to work... I found a lot of info. PS: What does INTP mean anyway? Couldn't find it in the acronym finder.

    C / C++ / MFC tutorial c++ help question learning

  • Trouble while trying to exit a dialog MFC App
    A andreir23

    THANKS! It worked! If GetKeyState(VK_ESCAPE) is -127 or -128 then the user pressed ESC and I will NOT exit the app. Otherwise yes.

    C / C++ / MFC c++ help question announcement

  • Open a file explorer in a dialog based MFC app
    A andreir23

    allrighte... If I get it, you want a button that will do exactly as if you'd press file->open? Simple: create that button, then set its ID at ID_FILE_OPEN. It's that simple... again.. I hope I got it right.. HTH, Andrei.

    C / C++ / MFC c++ question

  • Trouble while trying to exit a dialog MFC App
    A andreir23

    I have a small dialog-type MFC App In order to not exit the app if I press ESC or Enter I wrote this: void CVariantDlg::OnOK(){} void CVariantDlg::OnCancel(){} In other words I overloaded the functions OnOK() and OnCancel(). It worked! Now I can press ESC or Enter and the app won't close. My problem is that even if I hit ALT-F4 or right-click it on the taskbar and choose close or hit the x button in the right side of the title bar it won't close! This sucks. I guess I should check to see what are the latest keys pressed and choose from that point on. BTW: How did you call the original function from the overloaded version of it? Anyways... what do you recommend me in order to have the application exit on: a) X button from title bar b) ALT-F4 c) Close from the system menu / taskbar rightclick and "Close" But not: a) ESC b) ENter ? TIA! ;-)

    C / C++ / MFC c++ help question announcement

  • How do you modify a string from a string table and/or how you use it ?
    A andreir23

    Please don't flame me (too much)... I am still a beginner. I have a dialog type MFC app with 1 string table. I added there strings for all controls and visual messages to the user. All these in order to make my app multi-language prepared. I thought this way: "I have default strings for everything. Then I try to load a language.ini file and overwrite every string in the string table with the ones that I read from the ini file. This way if the ini file is incomplete, I won't have textless controls or messages" My problem is that I don't know how to : a) Modify (IF POSSIBLE?) a string stored in a string table b) Use a string from the string table as a parameter to a function that requires one. For example for MessageBox. Thank you. PS: One way to do b) that I found is: CString test; test.LoadString(IDS_STOP); MessageBox(test,"abc",MB_OK); Only I fear that there is a simpler way.

    C / C++ / MFC tutorial c++ help question learning

  • OPENFILENAME... not defined in my commdlg.h ??! Anyone could check in their .h file?
    A andreir23

    OPENFILENAME_SIZE_VERSION_400 is a constant used in OPENFILENAME structure (lStructSize member variable) but it seems it's nowhere in my PC including all .h files from Visual Studio. Whatever... I hope it's an exception and someone could tell me the numeric value for it so I can use it in my app. If you are so kind... :-) TNX!

    C / C++ / MFC csharp visual-studio question

  • GetOpenFileName structure member variable is tricky...
    A andreir23

    It doesn't work! My commdlg.h header file supplied with VC++6 does *not* include this definition at all. In fact no .h file from my distribution doesn't contain it. In a moment of desperation I searched brute-force-style ALL files on the hard drive for this string. None. Except cache files of Opera (web browser and text files that I wrote). Let's say I might (??!) have an incomplete distribution of this Visual Studio. What if I would nicely ask you if you could tell me the number value of this constant? It's probably unnecessary to tell you how to do that. Thank you. PS: Could it be the fact that I don't really like C ?!? Maybe it has a mind of its own and senses my hate? :-)

    C / C++ / MFC help question

  • GetOpenFileName structure member variable is tricky...
    A andreir23

    Here is my problem: In order to use GetOpenFileName I use a OPENFILENAME structure which has a member variable called lStructSize. In MSDN I am advised to use sizeof(OPENFILENAME) to initialize this one IF WINDOWS IS WIN2000 OR LATER!!! otherwise I should use OPENFILENAME_SIZE_VERSION_400. All is fine. I determine which type of Windows is my app running and use different initializations but this OPENFILENAME_SIZE_VERSION_400 seems undefined! What can I do?! TNX! ;-)

    C / C++ / MFC help question

  • Calling UpdateData(FALSE) will screw my RadioButton-group selection
    A andreir23

    Allrighte... But if I don't use that darn UpdateData, I CANNOT UPDATE the static text. Let me put the problem in a simpler manner: You have a static text (in Delphi it was called "Label") How do you modify its content and then update it visually so the darn thing on the screen reflects what you wrote in it?! I mean I mapped thru ClassWizard a CString to that static text control named m_Source. If I just say m_Source = "My text!!"; nothing on the screen changes. Especially that darn static text. How exactly do you recommend me to do it? TIA! ;-)

    C / C++ / MFC help question announcement

  • Calling UpdateData(FALSE) will screw my RadioButton-group selection
    A andreir23

    Here's my problem: I have 2 radio buttons in my dialog-based MFCAppWizard-made application (first radio button has "Group" property and is mapped to m_Operation). Their names are: "Encode" and "Decode" By default (in OnInitDialog) I select the first radio button (otherwise none would be selected at startup) with: m_Operation = 0; I have 2 Static Text controls (IDC_SOURCE and IDC_DESTINATION) both mapped thru ClassWizard to m_Source (CString type) and m_Destination (CString also) At a certain point the user selects a file and the app will write something to m_Source: m_Source = "C:\\MyFile.txt"; But that won't make it visible in the main form so I: UpdateData(FALSE); And it becomes visible. But MY PROBLEM IS THAT IN THAT MOMENT THE RADIO BUTTON SELECTION SCREWS UP. How is that? If "Decode" was selected before UpdateData(2nd radio button - "1") then "Encode" will become selected (1st radio button - "0"). HOW CAN I AVOID THIS? Not calling UpdateData or UpdateData() or UpdateData(TRUE) will cause this: m_Source = "C:\\AnyFile.txt"; does not update visually the static text control in my app. Please help?! ;-) Andrei Rinea

    C / C++ / MFC help question announcement

  • Simple Problem. How can I show an "Open file" dialog in a dialog-based App from MFC AppWizard
    A andreir23

    Thank you very much! It helped Now I also used GetSaveFileName ! :-D

    C / C++ / MFC c++ question delphi help

  • Simple Problem. How can I show an "Open file" dialog in a dialog-based App from MFC AppWizard
    A andreir23

    I am a Visual C++ newbie (I worked with Borland Delphi a long time so I know something... although not what I need now). I have to write a file encoder. In VC++ 6 Everything is set, I began a new project with MFC AppWizard, I selected dialog-based and now I have a dilemma: How do I show up an "Open file" dialog type window??! and a save one too... I would like if possible to be able to change the file filter and/or caption (I am developping it in another language) Like in Notepad when you hit CTRL-O or File->Open. I don't necesarily need it Win2000/XP style but I HOPE THERE IS A FUNCTION IN THE WIN SDK. In delphi it was so simple.Just drop a OpenFileDialog control on the main form and say: "Dialog1.Execute();" Visual C++ is certainly no RAD for me... Thanks in advance! ;-)

    C / C++ / MFC c++ question delphi help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups