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

Abin

@Abin
About
Posts
246
Topics
83
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • VC 2008 problem
    A Abin

    My guess is that he compiled/linked his application fine but it didn't work on other computers... applications developed using VC2008 would most likely require .NET framework to run, make sure your clients have .NET framework installed on their own machines.

    C / C++ / MFC help csharp visual-studio debugging announcement

  • OpenProcess Fails
    A Abin

    Could you please explain a bit more?

    C / C++ / MFC help question

  • OpenProcess Fails
    A Abin

    What would you do if ::OpenProcess(PROCESS_VM_READ, FALSE, dwProcessID) fails with error code 5 (Access is denied)? Where dwProcessID is a valid process ID. Is there any way to work around this problem?

    C / C++ / MFC help question

  • CHotKeyCtrl and "space"
    A Abin

    While being handy and nice, the MFC CHotKeyCtrl class does act weird sometimes, for example, it does not recognize the "space" key, instead, it rejects the keystroke and cleans all existing contents just like I pressed the "backspace" key. Now the funny thing is that, if I set the "space" key programmatically m_wndHotkey1.SetHotkey(VK_SPACE, 0); it will work, just that it cannot be specified by user input. Unfortunately I really want the "space" key to be one of the configurable hotkeys in my application. Do I have a way to work around this problem? Thank you.

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

  • Hight Quality Bitmap Stretching Displaying?
    A Abin

    Sometimes I need to display a bitmap much smaller then its original size, by using the StretchBlt API I get sadly ugly outcomes, I've noticed many picture-viewer applications have the ability of stretch-displaying pictures while maintaining high quality, some of them(IE 6.0, etc) can even do that job absolutely perfect. I wonder if I too can implement that in my own projects? Any help are appreciated.

    C / C++ / MFC graphics json help question career

  • Save into a UTF-8 file?
    A Abin

    I'm currently working on a project which needs to read contents from an ANSI text file and save into another text file in UTF-8 format, in fact it needs to convert about a thousand files from ANSI to UTF-8 and those old ANSI files must remain unmodified. Any suggestions? I'm not familiar with text encoding stuff...

    C / C++ / MFC question

  • Is there any way to verify a HHOOK?
    A Abin

    Well, for some odd reasons the GetMsgProc function in my application was never called, even though SetWindowsHookEx(WH_GETMESSAGE,GetMsgProc,m_hInstance,0) had succeeded... Weird isn't it? It was an MFC dialog based application.

    C / C++ / MFC question

  • Is there any way to verify a HHOOK?
    A Abin

    You are a lifesaver!

    C / C++ / MFC question

  • Is there any way to verify a HHOOK?
    A Abin

    In a recent project I used WH_JOURNALRECORD to moniter certain events occur in a particular application window, but as MSDN said, as soon as the user press "CTRL+ESC" or "CTRL+ALT+DEL", all installed WH_JOURNALRECORD hooks will be wiped out by the OS... When this happens, my application does not know, so it would still wait for messages(which will never come anymore) from the target window. My questions is that, is there any way to verify whether a HHOOK handle is still on a "valid" state, so I can reinstall the hook if needed? Thanks

    C / C++ / MFC question

  • Keyboard Input - MFC
    A Abin

    You need to do it in PreTranslateMessage. BOOL CMyDialog::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if (pMsg->message == WM_KEYDOWN) { if (pMsg->wParam == some_key_code) { Do_SomeThing(); } } return CDialog::PreTranslateMessage(pMsg); }

    C / C++ / MFC c++ debugging

  • Picking transparent color from a gif
    A Abin

    How do you programmatically set transparent color in a gif file? For example I have a gif file "c:\\a.gif", I wish to: Open c:\\a.gif. Set the black color, RGB(0,0,0), as the transparent color. Save the file back to c:\\a.gif. After that when I open c:\\a.gif using photoshop or whatever, the gif displays black as transparent color. Can we do that? Thank you.

    C / C++ / MFC adobe tutorial question

  • Retrieving Mouse State?
    A Abin

    Is there any API that allows me to retrieve mouse state? Not cursor position, but the presses/unpressed state of mouse buttons. Thanks.

    C / C++ / MFC json question

  • Stop removal of null characters
    A Abin

    As far as I can think, the closest solution should be replacing those null's with some other characters those otherwise will never be used in your application, for example, if your sure you'll never use the character '#', then:

    // how long is your header gonna be, then how many #'s here
    #define THE_HEADER _T("###...##")

    // To make your packet:
    CString sPacket = CString(THE_HEADER) + _T("your real contents");

    // Now send your packet
    socket.Send((LPCVOID)(LPCTSTR)sPacket, sPacket.GetLength() * sizeof(TCHAR));

    // And the receiver then replace the #'s with null's
    TCHAR szReceived[1024] = _T("");
    receiver.Receive((LPVOID)szReceived, 1023); // suppose 1023 is enough
    for (int i = 0; szReceived[i]; i++)
    {
    if (szReceived[i] == _T('#'))
    szReceived[i] = _T('\0');
    }

    // Now you get what you want

    C / C++ / MFC question com

  • MFC and its BOOL type...
    A Abin

    Yeah I was told about that before. Only thing I wonder, though, is that why they used an int not an BYTE, to represent such a type that merely needs to maintain "yes or no", but then I guess we've all used to that already.

    C / C++ / MFC c++ question

  • GetModuleHandle Problem
    A Abin

    Hi, every one, I got a problem when using the ::GetModuleHandle API, it always fails if I pass in an absolute path, for example, ::GetModuleHandle("c:\\my app\\app.dll"); will fail even though the file "c:\\my app\\app.dll" exists, but if I copy the program into that directory and call ::GetModuleHandle("app"); it succeeds. Why can't I use an absolute path for the module? Thank you.

    C / C++ / MFC json help tutorial question

  • Solution Needed Please
    A Abin

    I'm currently on a project which needs to exam memory contents of an other process, basically, it searchs for certain pattern in the target process's page memorys, if pattern found then do some further examination, else keeps searching for same pattern. I did it by this way: First, I use ::VirtualQueryEx to obtain all pages of the target process and store those page information(base address and page size) in an array. This step completes in no time. Second, I use ::ReadProcessMemory to read the memory from each page(bytes by bytes) and compare the bytes with my predefined pattern, which are an array of bytes, using memcmp. I will finally find the memory address that I want for sure, but the problem is that it's slow, very slow. The target process has over 500 pages and total size of which are over 70MB, it takes like 50 seconds to finish the searching, and that makes my application completely useless. Now since you guys are all gurus out here, I think there must be something to do to shorten the search time, please help and thanks in advance.

    C / C++ / MFC help algorithms data-structures regex performance

  • Get Window HANDLEs of a Process
    A Abin

    Having the process ID or HANDLE of a particular process, is there a way to find out its main window(or enum through all windows those were created by that process)? Thank you.

    C / C++ / MFC question

  • GDI Gurus, Ellipses
    A Abin

    I just wonder how ::Ellipse and ::ArcTo were implemented(or CDC::Ellipse, CDC::ArcTo in MFC library), I really wish I could have a chance to see the source code of those functions, or less than that, an idea how it was possible to draw an ellipse(not a circle) on the screen, by being given a mere boundary rectangle. I guess there got to be a lot of plane geometry involved, hell, wouldn't it be terribly time consuming to calculate coordinates of every single point on the arc?

    C / C++ / MFC c++ css graphics question

  • Is It Possible to do this?
    A Abin

    1. there is a title bar;

    BOOL bHasTitleBar = this->GetStyle() & WS_CAPTION;

    2. there is no caption on the title bar;

    CString sCaption;
    this->GetWIndowText(sCaption);
    BOOL bHasCaptionOnTheTitleBar = sCaption.GetLength() > 0;

    3. there is a caption on the windows task bar button.

    // Huh? If a window has caption on its title bar, then
    // it also has the same caption on the system task bar button,
    // if it does have a task bar button.
    // If you mean "this window has a task bar button"
    BOOL bHasTaskBarButton = (this->IsWindowVisible() && this == AfxGetMainWnd());

    C / C++ / MFC question

  • Show Desktop
    A Abin

    How do you programmatically show desktop, just like that ".scf" file(%APP_DATA%\\Microsoft\\Internet Explorer\\Show Desktop.scf) does?

    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