docs.miraculix.ru


Примеры приложений под MiraculixOS
  • Работа с файлами
  • Процессы
  • Графика
  • Контролы
  • Разное

  • Исходники программ
  • MsgBox
  • Run
  • Cmd
  • KeyCode

  • Разное
  • Скриншоты
  • .:: example_2.asm - SendMessage ::.

    ;==========================================
    ; Пример использования функции ShellAbout
    ;==========================================

    format PE

    include "..\include\win32ax.inc"
    include "..\include\const.inc"

    x_size = 150
    y_size = 100
    x_coord = 100
    y_coord = 100

    EventID_Ctrl3 = 13
    EventID_IPC = 50

    start:
    call Redraw
    Wait_Event:
    call [WaitMessage]
    call [StdHandler]
    cmp bx,(EventID_Ctrl3 shl 8) + 1
    jne Wait_Event

    invoke Get_FileAddress, filename
    invoke CreateProcess, esi,ebx,ProcessName
    mov [Process_PID],eax
    mov eax,'TEST'
    invoke SendMessage, [Process_PID],EventID_IPC shl 8,eax,eax

    jmp Wait_Event

    Redraw:
    invoke Draw_StdWindow, x_coord*65536+y_coord,x_size*65536+y_size,"SendMessage Example",00101b
    mov [WinID],eax
    invoke Create_StdButton, 20*65536+50,100*65536+20,"Send",1,10b
    call [End_of_redraw]
    ret

    data import
    ;
    ; Import functions:
    ;

    library mx32,'mx32.dll'

    import mx32,\
    WaitMessage,'WaitMessage',\
    Draw_StdWindow,'Draw_StdWindow',\
    StdHandler,'StdHandler',\
    End_of_redraw,'End_of_redraw',\
    Get_FileAddress,'Get_FileAddress',\
    CreateProcess,'CreateProcess',\
    SendMessage,'SendMessage',\
    Create_StdButton,'Create_StdButton'
    end data

    section '.data' data readable writeable
    Process_PID dd 0
    filename db 'test.exe',0
    ProcessName db 'Test Process',0
    WinID dd 0

    Copyright© 2007 by mistifi(ator