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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

mynab

@mynab
About
Posts
11
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • shareware / registration techniques....
    M mynab

    Forgot to mention that big disadvantage is that private key appears in the binary. Try to hide it for instance by creating a 64-char random string and then start your private key at say character 10. Again this is easily crackable but as I said if your shareware is worth being cracked it will be anyway.

    C / C++ / MFC help announcement

  • shareware / registration techniques....
    M mynab

    Hello, You should keep it simple: it will be cracked anyway if it catches some attention! I used an encryption algorithm (Blowfish in my case): I encrypt the e-mail of the registered user using a private key and the algo. You will get an hexadecimal buffer (16 chars ranging from 0 to 255) that you can translate to something that can be typed: for instance change each character to its written hexadecimal representation on two characters: this has the disadvantage of doubling the length of your serial number but that's the way it is. You get something like B0AA7D4350A88F... and so on. If you want to do an evaluation period for it you should refer to http://www.codeproject.com/system/cexpire01.asp[^], a good stuff available. Regards, mynab

    C / C++ / MFC help announcement

  • Detecting double-click on popup menu
    M mynab

    Hello, I would like to make something similar to the Start menu of 2000/XP: you can double click on any popup menu to open the item (therefore you can select items that are not leaves in your menu). Anyone has an idea how to do this? Regards, mynab

    C / C++ / MFC tutorial question

  • Controls not showing in Spy++
    M mynab

    Great! I found one working solution... Instead of clicking the OK button (that I can't find) I simulate a VK_RETURN keypress. Works in Office 2000 ; hoping it works in Office XP! ::SendMessage(pEdit->GetSafeHwnd(), WM_KEYDOWN, VK_RETURN, 0x001c0001); ::SendMessage(pEdit->GetSafeHwnd(), WM_CHAR, VK_RETURN, 0x001c0001); ::SendMessage(pEdit->GetSafeHwnd(), WM_KEYUP, VK_RETURN, 0xc01c0001); mynab

    C / C++ / MFC com question

  • Controls not showing in Spy++
    M mynab

    No the control does not appear in the tree either. Even if I spy all the messages and I move the mouse over the button, then the WM_SETCURSOR messages that appear have the HWND of the dialog. If I move the mouse over the Filename RichEdit then the WM_SETCURSOR has a different HWND... Of course I tried GetDlgItem(IDOK) on the dialog but it returns NULL. Seems I am really stuck!

    C / C++ / MFC com question

  • Controls not showing in Spy++
    M mynab

    Hello, I would like to programatically drive the Open file dialog of Office 2000/XP. I therefore got the ID of the edit control where one can enter a filename and was looking for the ID of the OK button to send it a BM_CLICK message. However the control does not show up in Spy++: when I drag the Finder tool then the dialog is hilited and not the button. What kind of control can this be? ActiveX? Will I be able to send it a BM_CLICK message (or anyhting else that will validate the change I made in the edit with a WM_SETTEXT)? How? Regards, mynab

    C / C++ / MFC com question

  • Tyring to get the icon of the desktop or "My Documents" or...
    M mynab

    ok i think i kinda fixed the code by using BindToObject on the desktop shell folder and it is working better: i do not get the icon 0 of explorer.exe for all my stuff!! but still it does not seem to work: for instance for "my documents" i always get the standard folder icon instead of the nice one. so my question comes back to: how can i know the icon displayed for a particular folder. i do not want to treat the "my documents" by hardcoding and getting the stuff from the registry using its CLSID because "my pictures", "my videos"... should be handled also! thanks for any reply and happy new year!! mynab

    C / C++ / MFC database help question

  • Tyring to get the icon of the desktop or "My Documents" or...
    M mynab

    Hello, I am trying to get the icon of those special locations but not the index in the system image list but the icon file and the index in the icon file. I use the following code: IShellFolder *pshf = NULL; SHGetDesktopFolder(&pshf); if (pshf != NULL) { void *pv = NULL; CItemIDList idlist(strPath); LPCITEMIDLIST apidl = LPCITEMIDLIST(idlist); HRESULT rc = pshf->GetUIObjectOf(NULL, 1, &apidl, IID_IExtractIcon, NULL, &pv); if (pv) { TCHAR szIconFile[MAX_CHAR]; memset(szIconFile, 0, MAX_CHAR); INT nIconIndex = 10; UINT nFlags; if ( ((IExtractIcon*)pv)->GetIconLocation(GIL_FORSHELL, szIconFile, MAX_CHAR, &nIconIndex, &nFlags) == S_OK && strlen(szIconFile) != 0) { // we got the solution return true; } } } This looks good but it does not work: if strPath is set to a folder then I get the icon 0 of explorer.exe which is not the good one. Most of the time nIconIndex is equal to 0. Can someone help me on this? Thanks mynab

    C / C++ / MFC database help question

  • Shell Extension Uninstall
    M mynab

    Hello, I would like to know the best way to upgrade/uninstall a shell extension. Simply unregistering is not enough as Explorer keeps the file locked for a certain amount of time. I also saw one piece of code that restarts the Shell but this is not very elegant because all the Startup Items are relaunched and this causes a mess not counting the disappearing and reappearing of the task bar... The method I have been using for the last year or so works but I would like to have something more simple. For instance an upgrade is done like this: my installer copies the .dll to a .tmp file then unregisters the .dll and tries to delete the .dll file. It the deletion is successful then the .tmp is renamed to .dll and is registered: everything is fine. If the deletion fails then my installer creates a .bat file that deletes the .dll, renames the .tmp, registers the dll and deletes itself (this is why it is a .bat file: a .bat can delete itself while running, a .exe can't). Then this .bat file is registered in the RunOnce section to be executed at the next reboot. Uninstallation follows the same kind of process. As you see this is kind of complex... I have been looking on the web for other way to do this but did not find any info. So anyone has something on this topic??

    C / C++ / MFC linux question

  • Playing a wave or mp3 file in my program
    M mynab

    This should do: HWND hWnd = MCIWndCreate(GetSafeHwnd(), AfxGetInstanceHandle(), MCIWNDF_NOMENU | MCIWNDF_NOPLAYBAR | MCIWNDF_NOERRORDLG | MCIWNDF_NOOPEN, szFilename); MCIWndPlay(hWnd); To stop playing: MCIWndStop(hWnd); MCIWndDestroy(hWnd);

    C / C++ / MFC tutorial question

  • Does file exist?
    M mynab

    Also for information there is a simple way to check if a file is writable or not:

    FILE *f = fopen(filename, "ab");
    if (!f)
    {
    // file is not writable
    }
    else
    {
    fclose(f);
    }

    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