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
C

confalonieri

@confalonieri
About
Posts
16
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Process command line
    C confalonieri

    Hi, Is it possible to get the command line of a process thanks to its id or handle ? Thank in advance. Robin.

    C / C++ / MFC question

  • CreateWindow
    C confalonieri

    Thank for your help. I solved my problem: MyProc was always returning 0 whatever the message was, whereas it has to treat Windows messages such as "WM_CREATE", ... (traditional messages to create a window). Now, I use "return DefWindowProc(_hWnd,_iMsg,_wParam,_lParam)" when I receive a Windows message different from my messages.

    C / C++ / MFC help question

  • CreateWindow
    C confalonieri

    MyProc is declared in a header as following: LRESULT CALLBACK fidLinkEventProc(HWND _hWnd, UINT _iMsg, WPARAM _wParam, LPARAM _lParam); and MyProc is defined in a .c file: LRESULT CALLBACK MyProc(HWND _hWnd, UINT _iMsg, WPARAM _wParam, LPARAM _lParam) { switch (_iMsg) { ... } return 0; }

    C / C++ / MFC help question

  • CreateWindow
    C confalonieri

    Hi, In my application I need to create an empty window just to receive messages and treat them. I wrote the following code: HINSTANCE hApi = (HINSTANCE) GetModuleHandle(NULL); if (! hApi) ...// manage error CHAR * WindowClassName = "MyWindowClass"; WNDCLASS WindowClassInfo; if (! GetClassInfo(hApi, WindowClassName, &WindowClassInfo)) { WindowClassInfo.hCursor = NULL; WindowClassInfo.hIcon = NULL; WindowClassInfo.lpszMenuName = NULL; WindowClassInfo.lpszClassName = WindowClassName; WindowClassInfo.hbrBackground = NULL; WindowClassInfo.hInstance = hApi; WindowClassInfo.style = CS_OWNDC | CS_VREDRAW | S_HREDRAW; WindowClassInfo.lpfnWndProc = (WNDPROC) MyProc; WindowClassInfo.cbClsExtra = 0; WindowClassInfo.cbWndExtra = 0; if (! RegisterClass(&WindowClassInfo)) ...//manage error } HWND hWnd = CreateWindow(WindowClassName, "MyWindow", WS_OVERLAPPEDWINDOW, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hApi, NULL); if (! hWnd) ...//manage error But, unfortunately, CreateWindow return NULL and GetLastError return 0 !!! Did anybody could help me ? Thanks in advance. Robin.

    C / C++ / MFC help question

  • mutex owned by a process
    C confalonieri

    Hi, In my application, I have a given process (I get its identifier as a DWORD, a pseudo HANDLE and its name) and a given mutex name and I have to know if this given mutex belongs to the given process. Does anybody know how to proceed ? Thanks, Robin.

    C / C++ / MFC tutorial question

  • process handles
    C confalonieri

    Hi, In my application, I get the ID of another process, and I'd like to get all the handles owned by this extern process. Does anybody know how to proceed ? Thanks, Robin.

    C / C++ / MFC tutorial question

  • Getting mutex process
    C confalonieri

    Hi, In my application, I have to get the ID or the name of the process that created a named mutex. Does anybody know how to proceed ? I use this code : HANDLE MutexHandle = ::OpenMutex(MUTEX_ALL_ACCESS, FALSE, MutexName); if (MutexHandle) { // mutex exists ::CloseHandle(MutexHandle); // how to get the process ID ? } else { // mutex doesn't exist } Thanks in advance, Robin.

    C / C++ / MFC tutorial question

  • getstyle
    C confalonieri

    Hi, I have created a class derived from CListBox but when I use the CWnd::GetStyle() method (inside or outside my class), I can't see if my listbox has a border or not... is it a bug from Visual C++ 6.0 ? I also used ::GetWindowLong() function, but the result is the same. Thanks in advance.

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

  • Scrollbar
    C confalonieri

    Hi. I'm trying to manage a listbox vertical scroll bar and I have a problem with the function OnVScroll when I drag the scroll box. In OnVScroll(), when the first parameter nSBCode is SB_THUMBPOSITION or SB_THUMBTRACK, the second parameter nPos is expected to indicate the position of the scroll box. nPos (which is a UINT) can be cast to an int, and then I realized that after 32768, (int) nPos is -32768 ! Then, (int) nPos increases up to 32768 and then -32768 again !!! How should I proceed to manage the scroll box position when the range of my vertical scroll bar is over 32768 ? Thanks.

    C / C++ / MFC help question

  • Copying files
    C confalonieri

    Hi. In my Visual C++ application, I have to copy some files from a directory to another one. How can I do that ? Thanks.

    C / C++ / MFC c++ question

  • Sending WM_CLOSE message to a Window
    C confalonieri

    Hi. I'd like to close an application by sending to its main window the WM_CLOSE message. What I do is getting the ID of the process I want to stop, and then I use EnumWindows() function to get all top-level windows in the screen and in the callback function EnumWindowCallBack(), I compare the process ID with the ID of each top-level window. When the ID is the same, I send to the window the WM_CLOSE message thanks to ::PostMessage(). But, unfortunately, it doesn't work all the times. It seems that the windows I get in the callback function EnumWindowCallBack() are not the main windows of the applications I want to stop... For example, with calc.exe, the window is closed after having posted the WM_CLOSE message twice but the process calc.exe is still running without a window... Has anyone already met this problem ? Is there a way to be sure to get the right window of an application (and not a child window that doesn't handle the WM_CLOSE message) ? Thanks.

    C / C++ / MFC help tutorial question

  • Accelerator
    C confalonieri

    Hi, I would like to associate an acclerator (for example Ctrl+S) to a button in a dialog window. What do I have to do ? I just have a function associated with the button ID. Thanks. Rob.

    C / C++ / MFC tutorial question

  • Sending an e-mail message
    C confalonieri

    Hi. How could I simply send an e-mail message in a VISUAL C++ application ? Do I have to use MAPI ? Thanks.

    C / C++ / MFC c++ question

  • Exporting a function from a DLL
    C confalonieri

    Hello, I don't manage to export a procedure from a DLL. I created a Win32 Dynamic Link Library with a function which declaration is: __declspec(dllexport) BOOL Ping(UINT uiTimeout); When I look at the overview of my resulting dll, I can see my function 'Ping' in the export table but I can't get its address from another project. In my project, I load the dll thanks to 'AfxLoadLibrary' but when I use 'GetProcAddress' to get the address of the 'Ping' function, I get a NULL pointer: typedef BOOL (* PINGFUNCTION)(UINT); HINSTANCE hDLL = AfxLoadLibrary(m_szControl); if (hDLL) { // Get the address of the ping function FARPROC pnProc = GetProcAddress((HMODULE) hDLL, "Ping"); PINGFUNCTION MyPingFunction = (PINGFUNCTION) pnProc; if (! MyPingFunction) { return ((int) GetLastError()); } }

    C / C++ / MFC

  • Ending processes notification
    C confalonieri

    Hello. I'm working on an application that displays processes state. I manage to get their handles thanks to "OpenProcess" function. Now I'd like my application to react when one of these processes terminates. How can I do ? I understand that I probably have to implement callback functions, but how ? Do I have to use "RegisterWaitForSingleObject" function ? Thanks.

    C / C++ / MFC question javascript

  • tab characters in CTreeView
    C confalonieri

    I have created a class derived from CTreeView to display some pieces of information about files. Among these pieces of information, I want to display code lines, and unfortunately tab characters ('\t') are replaced by invalid characters whereas I'd like them to be replaced by a fixed number of white spaces. What should I do to modify my class and to display tab characters as a fixed number of spaces ? Thanks.

    C / C++ / MFC 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