winapi - In MFC RegisterHotKey function don't respond -


in mfc registerhotkey function don't respond dll works fine if put same code in exe. using same code works in exe , putting in dll. making sure dll gets load , othere changes reflecting when run exe.

you using same code registering hotkey in dll in exe. problem. see documentation registerhotkey:

an application must specify id value in range 0x0000 through 0xbfff. a shared dll must specify value in range 0xc000 through 0xffff (the range returned globaladdatom function). avoid conflicts hot-key identifiers defined other shared dlls, dll should use globaladdatom function obtain hot-key identifier.

to use registerhotkey shared dll, need generate id value. value in correct range, call globaladdatom string parameter (see about atom tables: string atoms). create unique id, pass string representation of guid.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -