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
U

User 1052

@User 1052
About
Posts
27
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • File Save As from ATL (no MFC)
    U User 1052

    Here is a snippet of code where I am doing this OPENFILENAME OpenFileName; TCHAR szFile[MAX_PATH] = "\0"; strcpy( szFile, ""); // Fill in the OPENFILENAME structure to support a template // and hook. OpenFileName.lStructSize = sizeof(OPENFILENAME); OpenFileName.hwndOwner = NULL; OpenFileName.hInstance = NULL; OpenFileName.lpstrFilter = "Data Files\0*.DAT\0"; OpenFileName.lpstrCustomFilter = NULL; OpenFileName.nMaxCustFilter = 0; OpenFileName.nFilterIndex = 0; OpenFileName.lpstrFile = szFile; OpenFileName.nMaxFile = sizeof(szFile); OpenFileName.lpstrFileTitle = NULL; OpenFileName.nMaxFileTitle = 0; OpenFileName.lpstrInitialDir = "C:\\YourPath"; OpenFileName.lpstrTitle = "Select A File"; OpenFileName.nFileOffset = 0; OpenFileName.nFileExtension = 0; OpenFileName.lpstrDefExt = NULL; OpenFileName.lCustData = NULL; OpenFileName.lpfnHook = NULL; OpenFileName.lpTemplateName = NULL; OpenFileName.Flags = OFN_EXPLORER ; // Call the common dialog function. if (GetOpenFileName(&OpenFileName)) { strcpy(chFileName,(LPCTSTR)OpenFileName.lpstrFile); }

    C / C++ / MFC c++ question

  • How to call a com object's method that takes VARIANT * parameters?
    U User 1052

    Well it depends on what you want to put in the variant... but first you would do something like this... VARIANT v1,v2; VariantInit(&v1); VariantInit(&v2); then depending on what you are putting in there you have to fill in the vt... v1.vt = VT_BSTR; // for a bstr v1.vt = VT_I2; // for an int v1.vt = VT_I4; // for a long etc... then you would call your method yourobj->yourmethod(&v1,&v2);

    C / C++ / MFC question com tutorial

  • MFC
    U User 1052

    People usually just post those ?'s in the Visual C++ forum...

    Site Bugs / Suggestions c++ question

  • Adding MFC to ATL
    U User 1052

    Although you don't need mfc to use it... when you need an instance... try _Module.m_hInst

    C / C++ / MFC c++ com debugging help question

  • system wide keyboard and mouse hooks
    U User 1052

    Sorry... should have specified.. to make it system wide... make the 4th parameter of SetWindowsHookEx 0 (zero), instead of GetCurrentThreadID

    Article Writing

  • system wide keyboard and mouse hooks
    U User 1052

    Sorry... should have specified.. to make it system wide... make the 4th parameter of SetWindowsHookEx 0 (zero), instead of GetCurrentThreadID

    Article Writing

  • How about indicating each article's rating?
    U User 1052

    Well everyone has their own opinion... I just know that I won't post anything... because I don't feel like having it judged by everyone... I'll just stick to answering questions in the forums =)

    Site Bugs / Suggestions database question

  • How about indicating each article's rating?
    U User 1052

    I don't think the articles should get rated at all... I think it makes people hesitant to post anything... because they will be worried it will get a low rating...

    Site Bugs / Suggestions database question

  • system wide keyboard and mouse hooks
    U User 1052

    Somehting like this.... In your header file static LRESULT CALLBACK KeyboardHook (int nCode, WORD wParam, DWORD lParam ); static LRESULT CALLBACK MouseHook(int nCode, WORD wParam, DWORD lParam); In your source file LRESULT CALLBACK CClientDlg::KeyboardHook (int nCode, WORD wParam, DWORD lParam ) { if ( nCode >= 0 ) { // WHAT YOU WANT IT TO DO } return (int)CallNextHookEx(hHookKB, nCode, wParam, lParam); } LRESULT CALLBACK CClientDlg::MouseHook (int nCode, WORD wParam, DWORD lParam ) { mousecnt++; if ( nCode >= 0 ) { // WHAT DO YOU WANT IT TO DO } return (int)CallNextHookEx(hHookM, nCode, wParam, lParam); } In your initdialog or constructor hHookKB= (HHOOK)SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardHook, 0,GetCurrentThreadId()); hHookM= (HHOOK)SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseHook, 0,GetCurrentThreadId());

    Article Writing

  • system wide keyboard and mouse hooks
    U User 1052

    Somehting like this.... In your header file static LRESULT CALLBACK KeyboardHook (int nCode, WORD wParam, DWORD lParam ); static LRESULT CALLBACK MouseHook(int nCode, WORD wParam, DWORD lParam); In your source file LRESULT CALLBACK CClientDlg::KeyboardHook (int nCode, WORD wParam, DWORD lParam ) { if ( nCode >= 0 ) { // WHAT YOU WANT IT TO DO } return (int)CallNextHookEx(hHookKB, nCode, wParam, lParam); } LRESULT CALLBACK CClientDlg::MouseHook (int nCode, WORD wParam, DWORD lParam ) { mousecnt++; if ( nCode >= 0 ) { // WHAT DO YOU WANT IT TO DO } return (int)CallNextHookEx(hHookM, nCode, wParam, lParam); } In your initdialog or constructor hHookKB= (HHOOK)SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardHook, 0,GetCurrentThreadId()); hHookM= (HHOOK)SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseHook, 0,GetCurrentThreadId());

    Article Writing

  • New message boards
    U User 1052

    I like the new message boards.... are you going to post the source in an article? Had to ask =) Could you make the "Your Name" and "E-Mail" be stored in a cookie and auto fill in so we don't have to keep typing it in?

    Site Bugs / Suggestions

  • std string/wstring and DLL
    U User 1052

    First question: What is error C4251, can you post the message that is with it? Second... I've never tried to do what your doing (at least I don't think so), but in COM we have to use BSTR ... not strings .... don't know if that will help at all.

    C / C++ / MFC c++ design question

  • How to change background color of the "Group Box"?
    U User 1052

    Sorry about that... it was just hanging... so I hit submit again...

    C / C++ / MFC question tutorial

  • How to change background color of the "Group Box"?
    U User 1052

    In your header file CRect m_rcGroup; In you OnPaint handler do the following CBrush brshGroup; brshGroup.CreateSolidBrush(COLORREF(RGB(redval,greenval,blueval))); //replace red,green,blue vals w/ numbers 0-255 HBRUSH OldBrush =(HBRUSH)SelectObject(dc,brshGroup); GetDlgItem(IDC_YOURGROUP)->GetWindowRect(m_rcGroup); ScreenToClient(m_rcGroup); Rectangle(dc,m_rcGroup.left,m_rcGroup.top,m_rcGroup.right,m_rrcGroupcGate.bottom); SelectObject(dc,OldBrush);

    C / C++ / MFC question tutorial

  • How to change background color of the "Group Box"?
    U User 1052

    In your header file CRect m_rcGroup; In you OnPaint handler do the following CBrush brshGroup; brshGroup.CreateSolidBrush(COLORREF(RGB(redval,greenval,blueval))); //replace red,green,blue vals w/ numbers 0-255 HBRUSH OldBrush =(HBRUSH)SelectObject(dc,brshGroup); GetDlgItem(IDC_YOURGROUP)->GetWindowRect(m_rcGroup); ScreenToClient(m_rcGroup); Rectangle(dc,m_rcGroup.left,m_rcGroup.top,m_rcGroup.right,m_rrcGroupcGate.bottom); SelectObject(dc,OldBrush);

    C / C++ / MFC question tutorial

  • How to change background color of the "Group Box"?
    U User 1052

    In your header file CRect m_rcGroup; In you OnPaint handler do the following CBrush brshGroup; brshGroup.CreateSolidBrush(COLORREF(RGB(redval,greenval,blueval))); //replace red,green,blue vals w/ numbers 0-255 HBRUSH OldBrush =(HBRUSH)SelectObject(dc,brshGroup); GetDlgItem(IDC_YOURGROUP)->GetWindowRect(m_rcGroup); ScreenToClient(m_rcGroup); Rectangle(dc,m_rcGroup.left,m_rcGroup.top,m_rcGroup.right,m_rrcGroupcGate.bottom); SelectObject(dc,OldBrush);

    C / C++ / MFC question tutorial

  • add item under columns in a CListView
    U User 1052

    ListView_SetItemText(GetDlgItem(IDC_YOURLISTIVEW), iRowNumber, iColNumber,"Text"); ================== The original message was: how do you add items (subitems) under a column header in a CListView control?
    if you don't understand my question, please look at the image I attached. it should explain it.

    C / C++ / MFC question

  • WebBrowser
    U User 1052

    I'm a little confused about what you needed... but here is instruction on how to include the web browser control on a dialog. Go to project, Add To Project, Components and Controls. Go to Registered Active X controls and select Microsoft Web Browser. This should create the files WebBrowser2.cpp & .h In you dialog #inlcude “WebBrowser2.h” then when you want to fill in you browser with a site add the following CWebBrowser2* pBrowser = (CWebBrowser2*)GetDlgItem( IDC_EXPLORER1 ); COleVariant varEmpty = new COleVariant; pBrowser->Navigate( "http://www.carolecode.com", &varEmpty, &varEmpty,&varEmpty, &varEmpty ); ================== The original message was: Hi all,

    I want to add the functionality , that set the url document, right to left document and left to right document. In visual c++ , mfc. Please help....

    thanks Lilach.

    C / C++ / MFC c++ help

  • Keyboard hook
    U User 1052

    Are you using SetWindowsHookEx? If so can I see a snippet of the code you are using? ================== The original message was: Does anyone have experience with keyboard hooks?

    I have created a keyboard hook and it works just fine provided the exe driving the dll displays a dialog box with an edit control and the edit control has focus.

    However, if another app has focus, say Notepad.exe, then the keyboard hook never receives the messages.

    What I think I need is some way to force the keyboard hook to the top of the message chain.

    I would like to start a dialog with anyone that has worked with keyboard hooks before.

    Thank you.

    PMCGAHAN@UCSWORKS.COM

    C / C++ / MFC com question

  • Modeless Dialog Ending Help needed
    U User 1052

    You could pass a pointer to your modal dialog up to its child modeless dialog. Then place a function in your modal dialog that will allow you to set your message. Then from your modeless dialog you can call that function before you call enddialog. ================== The original message was: Hi all,
    I have a Dialog based app that creates a Modal Dialog Box
    that then creates some modeless dialog's.
    What I need to know is when a modeless dialog exits,
    I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished
    with a EndDialog.

    Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done.

    Regardz

    Colin Davies

    C / C++ / MFC data-structures help tutorial question
  • Login

  • Don't have an account? Register

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