<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900412</guid>
        <pubDate>Fri, 16 Feb 2024 15:05:25 +0000</pubDate>
        <title>Регистрация глобального хоткея</title>
        <link>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900412</link>
        <description><![CDATA[macomics: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=442472&view=findpost&p=3900355'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Majestio &#064; <time class="tag-quote__quoted-time" datetime="2024-02-16T08:23:18+03:00">16.02.24, 05:23</time></span><div class='quote '>но если будут решения для X11, в частности для xfce4</div></div><br>
Для этого можно использовать XCB -- xcb_grab_key или Xlib -- XGrabKey<br>
Смотря что у вас там под xfce установлено. Но вообще должно работать как через Xlib так и через XCB<br>
<br>
Пример для них поищу, но с 0 писать долго - нету хэадеров для fasm1.]]></description>
        <author>macomics</author>
        <category>Assembler</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900400</guid>
        <pubDate>Fri, 16 Feb 2024 12:49:15 +0000</pubDate>
        <title>Регистрация глобального хоткея</title>
        <link>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900400</link>
        <description><![CDATA[macomics: По сути из всего примера надо вот это:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_HOTKEY ; строка 48 - переход на обработку соответствующего сообщения</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jz &nbsp; &nbsp; &nbsp;.wmhotkey</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GlobalAddAtom, addr szHotKeyName ; строка 58 - по сообщению wm_create регистрация горячей клавиши</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [wHotKeyId], ax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;RegisterHotKey, [hwnd], [wHotKeyId], MOD_WIN or MOD_NOREPEAT, 0x5A</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp;.wmhotkey: ; строка 114 - обработка сообщения от горячей клавиши (т.к. она одна, то я не распознавал её, подробности в wparam и lparam)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;MessageBox, HWND_DESKTOP, &quot;Hello&quot;, addr _title, MB_OK</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; .finish</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;UnregisterHotKey, [hwnd], [wHotKeyId] ; строка 124 - по сообщению wm_destroy необходимо отключить горячую клавишу</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp;szHotKeyName db &#39;Win+Z hot key&#39;, 0 ; строка 136 - произвольная строка наименования горячей клавиши (добавляется через GlobalAddAtom)</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp;wHotKeyId dw ? ; строка 151 - hAtom строки описания горячей клавиши</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;GlobalAddAtom, &#39;GlobalAddAtomA&#39;,\ ; строка 136 - добавление импорта функции из kernel32.dll</div><div class="code_line">; ...</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;RegisterHotKey, &#39;RegisterHotKey&#39;,\ ; строка 168 - добавление импорта функции из user32.dll</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;UnregisterHotKey, &#39;UnregisterHotKey&#39;,\</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>macomics</author>
        <category>Assembler</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900396</guid>
        <pubDate>Fri, 16 Feb 2024 10:59:04 +0000</pubDate>
        <title>Регистрация глобального хоткея</title>
        <link>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900396</link>
        <description><![CDATA[Majestio: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=442472&view=findpost&p=3900370'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>macomics &#064; <time class="tag-quote__quoted-time" datetime="2024-02-16T07:18:47+00:00">16.02.24, 07:18</time></span><div class='quote '>Добавил регистрацию HotKey, обработку и освобождение.<br>
Или вам надо, чтобы приложение запускалось по этой HotKey?</div></div><br>
Нет нет, нужно действие по хоткею ... Пасип за пример, гляну поразбираюсь.]]></description>
        <author>Majestio</author>
        <category>Assembler</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900370</guid>
        <pubDate>Fri, 16 Feb 2024 07:18:47 +0000</pubDate>
        <title>Регистрация глобального хоткея</title>
        <link>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900370</link>
        <description><![CDATA[macomics: Вот это? Стандартный пример из fasm1 WIN64/OPENGL<br>
Добавил регистрацию HotKey, обработку и освобождение.<br>
Или вам надо, чтобы приложение запускалось по этой HotKey?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">; OpenGL programming example</div><div class="code_line">&nbsp;</div><div class="code_line">format PE64 GUI 5.0</div><div class="code_line">entry start</div><div class="code_line">&nbsp;</div><div class="code_line">include &#39;win64a.inc&#39;</div><div class="code_line">&nbsp;</div><div class="code_line">include &#39;opengl.inc&#39;</div><div class="code_line">&nbsp;</div><div class="code_line">MOD_WIN &nbsp; &nbsp; &nbsp;= 0x0008</div><div class="code_line">MOD_NOREPEAT = 0x4000</div><div class="code_line">&nbsp;</div><div class="code_line">section &#39;.text&#39; code readable executable</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;start:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sub &nbsp; &nbsp; rsp,8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Make stack dqword aligned</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetModuleHandle,0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [wc.hInstance],rax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;LoadIcon,0,IDI_APPLICATION</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [wc.hIcon],rax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;LoadCursor,0,IDC_ARROW</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [wc.hCursor],rax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;RegisterClass,wc</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_OVERLAPPEDWINDOW+WS_CLIPCHILDREN+WS_CLIPSIBLINGS,16,16,432,432,NULL,NULL,[wc.hInstance],NULL</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;msg_loop:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetMessage,addr msg,NULL,0,0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; eax,1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jb &nbsp; &nbsp; &nbsp;end_loop</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jne &nbsp; &nbsp; msg_loop</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;TranslateMessage,addr msg</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;DispatchMessage,addr msg</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; msg_loop</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;end_loop:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;ExitProcess,[msg.wParam]</div><div class="code_line">&nbsp;</div><div class="code_line">proc WindowProc uses rbx rsi rdi, hwnd,wmsg,wparam,lparam</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [hwnd],rcx</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;frame</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_SIZE</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;.wmsize</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_PAINT</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;.wmpaint</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_KEYDOWN</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;.wmkeydown</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_HOTKEY</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jz &nbsp; &nbsp; &nbsp;.wmhotkey</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_DESTROY</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;.wmdestroy</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; edx,WM_CREATE</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;.wmcreate</div><div class="code_line">&nbsp;&nbsp;.defwndproc:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;DefWindowProc,rcx,rdx,r8,r9</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; .finish</div><div class="code_line">&nbsp;&nbsp;.wmcreate:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GlobalAddAtom, addr szHotKeyName</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [wHotKeyId], ax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;RegisterHotKey, [hwnd], [wHotKeyId], MOD_WIN or MOD_NOREPEAT, 0x5A</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetDC,rcx</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [hdc],rax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lea &nbsp; &nbsp; rdi,[pfd]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; rcx,sizeof.PIXELFORMATDESCRIPTOR shr 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax,eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rep &nbsp; &nbsp; stosq</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.nSize],sizeof.PIXELFORMATDESCRIPTOR</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.nVersion],1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.dwFlags],PFD_SUPPORT_OPENGL+PFD_DOUBLEBUFFER+PFD_DRAW_TO_WINDOW</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.iLayerType],PFD_MAIN_PLANE</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.iPixelType],PFD_TYPE_RGBA</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.cColorBits],16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.cDepthBits],16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.cAccumBits],0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [pfd.cStencilBits],0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;ChoosePixelFormat,[hdc],addr pfd</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;SetPixelFormat,[hdc],eax,addr pfd</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;wglCreateContext,[hdc]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [hrc],rax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;wglMakeCurrent,[hdc],[hrc]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetClientRect,[hwnd],addr rc</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glViewport,0,0,[rc.right],[rc.bottom]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetTickCount</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; [clock],eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax,eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; .finish</div><div class="code_line">&nbsp;&nbsp;.wmsize:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetClientRect,[hwnd],addr rc</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glViewport,0,0,[rc.right],[rc.bottom]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax,eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; .finish</div><div class="code_line">&nbsp;&nbsp;.wmpaint:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;GetTickCount</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sub &nbsp; &nbsp; eax,[clock]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; eax,10</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jb &nbsp; &nbsp; &nbsp;.animation_ok</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;add &nbsp; &nbsp; [clock],eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glRotatef,float [theta],float dword 0.0,float dword 0.0,float dword 1.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;.animation_ok:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glClear,GL_COLOR_BUFFER_BIT</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glBegin,GL_QUADS</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glColor3f,float dword 1.0,float dword 0.1,float dword 0.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glVertex3d,float -0.6,float -0.6,float 0.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glColor3f,float dword 0.1,float dword 0.1,float dword 0.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glVertex3d,float 0.6,float -0.6,float 0.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glColor3f,float dword 0.1,float dword 0.1,float dword 1.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glVertex3d,float 0.6,float 0.6,float 0.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glColor3f,float dword 1.0,float dword 0.1,float dword 1.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glVertex3d,float -0.6,float 0.6,float 0.0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;glEnd</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;SwapBuffers,[hdc]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax,eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; .finish</div><div class="code_line">&nbsp;&nbsp;.wmhotkey:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;MessageBox, HWND_DESKTOP, &quot;Hello&quot;, addr _title, MB_OK</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jmp &nbsp; &nbsp; .finish</div><div class="code_line">&nbsp;&nbsp;.wmkeydown:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; r8d,VK_ESCAPE</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jne &nbsp; &nbsp; .defwndproc</div><div class="code_line">&nbsp;&nbsp;.wmdestroy:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;wglMakeCurrent,0,0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;wglDeleteContext,[hrc]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;ReleaseDC,[hwnd],[hdc]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;UnregisterHotKey, [hwnd], [wHotKeyId]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;invoke &nbsp;PostQuitMessage,0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax,eax</div><div class="code_line">&nbsp;&nbsp;.finish:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;endf</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret</div><div class="code_line">endp</div><div class="code_line">&nbsp;</div><div class="code_line">section &#39;.data&#39; data readable writeable</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;_title db &#39;OpenGL example&#39;,0</div><div class="code_line">&nbsp;&nbsp;_class db &#39;FASMOPENGL32&#39;,0</div><div class="code_line">&nbsp;&nbsp;szHotKeyName db &#39;Win+Z hot key&#39;, 0</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;theta GLfloat 0.6</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,NULL,NULL,_class</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;hdc dq ?</div><div class="code_line">&nbsp;&nbsp;hrc dq ?</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;msg MSG</div><div class="code_line">&nbsp;&nbsp;rc RECT</div><div class="code_line">&nbsp;&nbsp;pfd PIXELFORMATDESCRIPTOR</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;clock dd ?</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;wHotKeyId dw ?</div><div class="code_line">&nbsp;</div><div class="code_line">section &#39;.idata&#39; import data readable writeable</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;library kernel,&#39;KERNEL32.DLL&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;user,&#39;USER32.DLL&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gdi,&#39;GDI32.DLL&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;opengl,&#39;OPENGL32.DLL&#39;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;import kernel,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; GetModuleHandle,&#39;GetModuleHandleA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; GetTickCount,&#39;GetTickCount&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; GlobalAddAtom, &#39;GlobalAddAtomA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ExitProcess,&#39;ExitProcess&#39;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;import user,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; MessageBox, &#39;MessageBoxA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; RegisterHotKey, &#39;RegisterHotKey&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; UnregisterHotKey, &#39;UnregisterHotKey&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; RegisterClass,&#39;RegisterClassA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; CreateWindowEx,&#39;CreateWindowExA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; DefWindowProc,&#39;DefWindowProcA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; GetMessage,&#39;GetMessageA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; TranslateMessage,&#39;TranslateMessage&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; DispatchMessage,&#39;DispatchMessageA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; LoadCursor,&#39;LoadCursorA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; LoadIcon,&#39;LoadIconA&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; GetClientRect,&#39;GetClientRect&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; GetDC,&#39;GetDC&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ReleaseDC,&#39;ReleaseDC&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; PostQuitMessage,&#39;PostQuitMessage&#39;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;import gdi,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ChoosePixelFormat,&#39;ChoosePixelFormat&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; SetPixelFormat,&#39;SetPixelFormat&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; SwapBuffers,&#39;SwapBuffers&#39;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;import opengl,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; wglCreateContext,&#39;wglCreateContext&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; wglMakeCurrent,&#39;wglMakeCurrent&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; wglDeleteContext,&#39;wglDeleteContext&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glClear,&#39;glClear&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glBegin,&#39;glBegin&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glViewport,&#39;glViewport&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glRotatef,&#39;glRotatef&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glColor3f,&#39;glColor3f&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glVertex3d,&#39;glVertex3d&#39;,\</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; glEnd,&#39;glEnd&#39;</div></ol></div></div></div></div>]]></description>
        <author>macomics</author>
        <category>Assembler</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900355</guid>
        <pubDate>Fri, 16 Feb 2024 05:23:18 +0000</pubDate>
        <title>Регистрация глобального хоткея</title>
        <link>https://forum.sources.ru/index.php?showtopic=442472&amp;view=findpost&amp;p=3900355</link>
        <description><![CDATA[Majestio: Всем прива&#33;<br><br>В проге нужно зарегать глобальный хоткей Win Z + Z. Нужен хелп:<br><br>1) Проверить, не занят ли этот хоткей<br>2) Как повесить обработчик на него<br><br>Советы не нужны. Нужны примеры кода для fasm :rolleyes:<br><br>ЗЫ: Вопросы для M&#036; Windows, но если будут решения для X11, в частности для xfce4, я буду еще более благодарен&#33;]]></description>
        <author>Majestio</author>
        <category>Assembler</category>
      </item>
	
      </channel>
      </rss>
	