The MASM Forum

Microsoft 64 bit MASM => Mikl__'s ml64 examples => Topic started by: Mikl__ on May 26, 2017, 08:43:47 PM

Title: Uncle Remus Tales
Post by: Mikl__ on May 26, 2017, 08:43:47 PM
Uncle Remus Tales
(http://wasm.in/forum/attachments/skazki-dyaduschki-rimusa4-jpg.198/?temp_hash=cceddd42436bb47e6949cf2c3d9ce12b)
Consider this cycle a parody that Joel Chandler Harris wrote on the "Iczelion Lessons" rewritten under Win x64
Drawings from the movie "Song of the South" (1946) are kindly provided (http://wasm.in/forum/attachments/twdc_logo-svg-png.274/?temp_hash=2da92c7ab6bbb6ea43dbd55893f45158)
Uncle Remus tales:#37i gif-animation
; GUI #
include win64a.inc
include gdiplus.inc
includelib gdiplus.lib

PropertyTagFrameDelay  equ 5100h
cdXPos          equ 127
cdYPos          equ 127
cdXSize         equ 200
cdYSize         equ 100
cdVBarTipo      equ 0
cdMainIcon      equ 100
cdIdTimer       equ 1
.code
WinMain proc
local msg:MSG
local ptDiff:POINT
local rctWnd:RECT
local rctClient:RECT
local nSize:qword
local pDimensionIDs:qword
local count:qword

;инициализация библиотеки GDIPLUS
mov ecx,offset gdiplusToken
mov edx,offset gsi
invoke GdiplusStartup,,,0

xor ebx,ebx
mov edi,offset ClassName
mov ecx,offset FileName
invoke LoadCursorFromFile

push rax ;hIconSm
push rdi ;lpszClassName
push rbx ;lpszMenuName
push COLOR_WINDOWTEXT ;hbrBackground
push 10003h ;hCursor
push rax ;hIcon
push IMAGE_BASE ;hInstance
push rbx ;cbClsExtra & cbWndExtra
pushaddr WndProc  ;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX

        mov ecx,offset szfilename
mov edx,offset g_image
invoke GdipLoadImageFromFile
;TestForAnimatedGIF-------------------------------
lea edx,count
mov [rdx],ebx;count=0
mov ecx,g_image
invoke GdipImageGetFrameDimensionsCount
mov ecx,dword ptr count
test ecx,ecx
jz @f
shl ecx,4
invoke GdipAlloc

mov dword ptr pDimensionIDs,eax
mov ecx,g_image
invoke GdipImageGetFrameDimensionsList,,eax,count
or eax,eax
jnz @f
mov r8d,offset nFrameCount
mov ecx,g_image
invoke GdipImageGetFrameCount,,pDimensionIDs
or eax,eax
jnz @f
lea r8d,nSize
mov ecx,g_image
invoke GdipGetPropertyItemSize,,PropertyTagFrameDelay
or eax,eax
jnz @f
mov ecx,dword ptr nSize
shl ecx,2
invoke GdipAlloc
mov pPropertyItem,eax
mov ecx,g_image
invoke GdipGetPropertyItem,,PropertyTagFrameDelay,nSize,eax
or eax,eax
jnz @f
mov ecx,dword ptr pDimensionIDs
        invoke GdipFree
@@:;------------------------------------
mov edx,offset nWidth
mov ecx,g_image
call GdipGetImageWidth
mov edx,offset nHeight
mov ecx,g_image
call GdipGetImageHeight

push rbx
push IMAGE_BASE
push rbx
push rbx
push cdYSize ; nHeight
push cdXSize ; nWidth
push cdYPos ; Y
push cdXPos ; X
sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
        mov hMainWnd,eax
        lea edx,rctClient ;lpRect
invoke GetClientRect,eax
lea edx,rctWnd ;lpRect
mov ecx,hMainWnd
invoke GetWindowRect
mov eax,rctWnd.right
sub eax,rctWnd.left
sub eax,rctClient.right
mov ptDiff.x,eax
mov eax,rctWnd.bottom
sub eax,rctWnd.top
sub eax,rctClient.bottom
mov ptDiff.y,eax
mov qword ptr [rsp+28h],TRUE ; bRepaint
        mov ecx,nHeight
add ecx,ptDiff.y
mov [rsp+20h],rcx ;nHeight
mov eax,nWidth
add eax,ptDiff.x
mov ecx,hMainWnd
invoke MoveWindow,,cdXPos,cdYPos,rax
lea edi,msg
@@: invoke GetMessage,edi,NULL,0,0
cmp msg.wParam,VK_ESCAPE;user press 'Esc'?
je wmDESTROY
invoke DispatchMessage,edi
jmp @b
WinMain endp
WndProc proc hWnd:qword,umsg:qword,wParam:qword,lParam:qword
local ps:PAINTSTRUCT
local graphics:qword

mov hWnd,rcx
mov wParam,r8
mov lParam,r9

cmp edx,WM_DESTROY
je wmDESTROY
cmp edx,WM_CREATE
je wmCREATE
cmp edx,WM_SIZE
je wmSIZE
cmp edx,WM_PAINT
je wmPAINT
cmp edx,WM_TIMER
je wmTIMER
leave
        jmp DefWindowProc
wmDESTROY::invoke KillTimer,,cdIdTimer
cmp g_image,0
jz @f
mov ecx,g_image
invoke GdipDisposeImage
@@: cmp pPropertyItem,0
jz @f
mov ecx,pPropertyItem
invoke GdipFree
@@: invoke ExitProcess,NULL
wmPAINT:lea edx,ps
invoke BeginPaint
;DrawFrameGIF---------------------
mov edx,offset nWidth
mov ecx,g_image
invoke GdipGetImageWidth
or eax,eax
jnz @f
mov edx,offset nHeight
mov ecx,g_image
invoke GdipGetImageHeight
or eax,eax
jnz @f
lea edx,graphics
invoke GdipCreateFromHDC,ps.hdc
mov eax,dword ptr vdyClient
mov [rsp+28h],rax
mov eax,dword ptr vdxClient
mov [rsp+20h],rax
mov edx,g_image
invoke GdipDrawImageRectI,graphics,,0,0
invoke GdipDeleteGraphics,graphics
mov r8d,nFramePosition
inc nFramePosition
mov edx,offset pageGuid
mov ecx,g_image
invoke GdipImageSelectActiveFrame
mov eax,nFramePosition
sub eax,nFrameCount
jnz @f
mov nFramePosition,eax
;-------------------------------
@@: lea edx,ps
invoke EndPaint,hWnd
jmp wmBYE
wmTIMER:invoke InvalidateRect,,0,0
jmp wmBYE
wmCREATE:invoke SetTimer,,cdIdTimer,100,0
jmp wmBYE
wmSIZE: mov rax,r9;lParam
mov vdxClient,ax
shr eax,10h
mov vdyClient,ax
jmp wmBYE
wmBYE: leave
retn
WndProc endp
;-----------------------------------
ClassName db "Uncle Remus tales:#37i gif animation",0
FileName db "br_Rabbit3.cur",0
gsi GdiplusStartupInput <1,0,0,0,0>
pageGuid GUID <6AEDBD6Dh,3FB5h,418Ah,<83h,0A6h,7Fh,45h,22h,9Dh,0C8h,72h>>
szfilename: du <movie.gif>
gdiplusToken dd ?
nWidth dd ?
nHeight dd ?
vdxClient dw 0,0
vdyClient dw 0,0
nFrameCount dd ?
nFramePosition dd 0
pPropertyItem dd ?
g_image dd ?
hMainWnd dd ?
end
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 26, 2017, 08:49:03 PM
rename files movie.01.zip, movie.02.zip, movie.03.zip, movie.04.zip to movie.zip.001, movie.zip.002, movie.zip.003, movie.zip.004 and unzip they
to be continued
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 26, 2017, 08:50:14 PM
to be continued
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 26, 2017, 08:52:07 PM
completion
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 26, 2017, 08:55:03 PM
completion
Title: Re: Uncle Remus Tales
Post by: Siekmanski on May 27, 2017, 12:41:26 AM
I renamed the files, but couldn't unzip the movie. (unknown format or corrupt file)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 27, 2017, 01:01:10 AM
Hi, Siekmanski!
I used 7-zip (www.7-zip.org) compression level=Maximum, compression method=default, dictionary size=32 KB, word size=64
Result is "movie.zip" folder with "movie.gif" file, size is 1730254 bytes. I just checked. File movie.gif downloaded and unpacked without errors
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 27, 2017, 06:07:19 PM
Uncle Remus tales:#37j simple animation
; GUI #
include win64a.inc
include gdiplus.inc
includelib gdiplus.lib
ILD_NORMAL equ 0
.code
WinMain proc
local msg:MSG
local hwnd:qword

;inizialisation GDIPLUS
mov ecx,offset gdiplusToken
mov edx,offset gsi
invoke GdiplusStartup,,,0

xor ebx,ebx
mov esi,IMAGE_BASE
mov edi,offset ClassName
mov ecx,offset FileName
invoke LoadCursorFromFile
push rax ;hIconSm
push rdi ;lpszClassName
push rbx ;lpszMenuName
push COLOR_WINDOWTEXT;hbrBackground
push 10003h ;hCursor
push rax    ;hIcon
push rsi ;hInstance
push rbx    ;cbClsExtra & cbWndExtra
pushaddr WndProc  ;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX

push rbx
push rsi ;rsi=400000h
shl esi,9 ;rsi=CW_USEDEFAULT
push rbx
push rbx
push 180;rsi
push 170;
push rsi
push rsi
sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
    mov hwnd,rax
        and  qword ptr [rsp+20h],0
invoke ImageList_Create,153,147,ILC_COLOR24,1
mov hList,eax

        mov ecx,offset FilenameW
mov edx,offset pImage
invoke GdipCreateBitmapFromFile
mov edx,offset hBmp
invoke  GdipCreateHBITMAPFromBitmap,pImage,,0
invoke  GdipDisposeImage,pImage

mov edx,hBmp
mov ecx,hList
invoke ImageList_Add,,,0
mov ecx,hBmp
invoke DeleteObject
        invoke GetDC,hwnd
        mov hDC,eax
        mov r9d,offset Draw
        invoke SetTimer,hwnd,1,40;1000/25=40
lea edi,msg
@@: invoke GetMessage,edi,NULL,0,0
invoke DispatchMessage,edi
jmp @b
WinMain endp
WndProc:
cmp edx,WM_DESTROY
je wmDESTROY
        jmp DefWindowProc
wmDESTROY:invoke ExitProcess,NULL
;-------------------------------------
Draw proc
        enter 30h,0
and qword ptr [rbp-8],ILD_NORMAL; drawing style
and qword ptr [rbp-10h],0;y-coordinate to draw at
mov edx,count
mov r8d,hDC
mov ecx,hList
invoke ImageList_Draw,,,,0
inc count
cmp count,210
jb @f
and count,0
@@: leave
ret
Draw endp
;-----------------------------------
align 2
FilenameW: du <all3.jpg>
ClassName db "Uncle Remus tales:#37j Simple animation",0
gsi GdiplusStartupInput <1,0,0,0,0>
FileName db "br_Rabbit3.cur",0
gdiplusToken dd ?
hBmp dd ?
count dd ?
hList dd ?
hDC dd ?
pImage dq ?
end
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 27, 2017, 06:10:07 PM
rename files 37j.001.zip, 37j.002.zip, 37j.003.zip, 37j.004.zip to 37j.zip.001, 37j.zip.002, 37j.zip.003, 37j.zip.004 and unzip they
to be continued
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 27, 2017, 06:13:08 PM
to be continued
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 27, 2017, 06:14:24 PM
completion
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 29, 2017, 11:47:20 PM
Uncle Remus tales:#37a Animation
We are writing a player based on the SysAnimate32 class. We create a window, on this window we upload a child window with the class SysAnimate32 indicating the file that we want to play.
Create a child window using the CreateWindowEx function. We do not need to register the window class, since it was already registered by Windows. When creating the screen, specify "SysAnimate32" as the class name for CreateWindowsEx. Other parameters that we must specify are the handle of the parent window and the ID of the control. The control ID should be unique if we used several controls to distinguish this control from others. But since the control we have is the only one set ID = 0. We also need to specify the screen sizes and the coordinates of its upper left corner. Normally, the child window is created during the processing of the WM_CREATE message of the main window. We will create a child window before processing the message loop. After creating the animation management tool, we send the ACM_OPEN message via the SendMessage function to open the AVI clip and load it into memory. The message specifies the path to the AVI file.LRESULT WINAPI SendMessage(
  _In_ HWND   hWndControl, //A handle to the window whose window procedure will receive the message
  _In_ UINT ACM_OPEN, //The message to be sent
  _In_ WPARAM hinst, //Additional message-specific information
  _In_ LPARAM lpszName      //Additional message-specific information
);
Parameters
; GUI #
include win64a.inc
ACM_OPEN = WM_USER + 100
ACS_AUTOPLAY = 4
ID_ANIMATE = 101
.code
WinMain proc
local msg:MSG
local hwnd:QWORD

xor ebx,ebx
mov esi,IMAGE_BASE
mov ecx,offset FileNameCur
invoke LoadCursorFromFile
mov edi,offset ClassName
push rax ;hIconSm
push rdi ;lpszClassName
push rbx ;lpszMenuName
push COLOR_WINDOW;hbrBackground
push 10005h ;hCursor
push rax        ;hIcon
push rsi ;hInstance
push rbx        ;cbClsExtra & cbWndExtra
pushaddr WndProc      ;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
    invoke RegisterClassEx,esp ;addr WNDCLASSEX

push rbx
push rsi ;rsi=400000h
push rbx
push rbx
push 440
push 510
push 10
push 10
sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_CAPTION or WS_SYSMENU or WS_VISIBLE
mov hwnd,rax

push rbx
push rsi;IMAGE_BASE
push ID_ANIMATE
push rax;hwnd
push rbx;The width and height of the frame will be adjusted automatically
push rbx
push 20
push 20
sub esp,20h
mov r8d,offset NoText
mov edx,offset Animate32
invoke CreateWindowEx,WS_EX_STATICEDGE+WS_EX_CLIENTEDGE,,,WS_CHILD+WS_VISIBLE+WS_TABSTOP+ACS_AUTOPLAY

movr qword ptr [rsp+20h],AviFile
    invoke SendDlgItemMessage,hwnd,ID_ANIMATE,ACM_OPEN,IMAGE_BASE

    lea edi,msg
@@:     invoke GetMessage,edi,0,0,0
        invoke DispatchMessage,edi
        jmp @b
WinMain endp
WndProc: cmp edx,WM_DESTROY
je wmDESTROY
        jmp DefWindowProc
wmDESTROY:invoke ExitProcess,0
;---------------------------------------
ClassName db 'Uncle Remus tales:#37a Animation',0
FileNameCur db "br_Rabbit3.cur",0
AviFile db 'output.avi',0
Animate32 db "SysAnimate32"
NoText db 0
end
There is link for output.avi (https://yadi.sk/i/J4bVuX4H3JdByJ) file. To play via "SysAnimate32", the avi-file should not be compressed (therefore it has such a large size) and can not contain audio data
Title: Re: Uncle Remus Tales
Post by: Mikl__ on May 30, 2017, 10:23:20 PM
Read 129 times, downloaded 1 times
Is my english so terrible? Or the topic is completely uninteresting?
Title: Re: Uncle Remus Tales
Post by: jj2007 on May 30, 2017, 10:30:54 PM
No, your English is good, your code is excellent, as usual :t

I even quoted you here (http://masm32.com/board/index.php?topic=94.msg67229#msg67229) ;-)

push rbx ; ширина и высота кадра настроятся автоматически
push rbx ; The width and height of the frame will be adjusted automatically


But I had to write a little converter to see your cyrillic comments:

include \masm32\MasmBasic\MasmBasic.inc      ; download (http://masm32.com/board/index.php?topic=94.0)
  Init
  Let esi=Cat$(Utf8Bom+ConvertCp$(FileRead$("tut_37a.asm"), 1251, CP_UTF8))
  FileWrite "tut_37aUtf8.asc", esi
  ShEx "tut_37aUtf8.asc"
EndOfCode
Title: Re: Uncle Remus Tales
Post by: nidud on May 31, 2017, 12:03:41 AM
deleted
Title: Re: Uncle Remus Tales
Post by: jj2007 on May 31, 2017, 12:24:08 AM
Quote from: nidud on May 31, 2017, 12:03:41 AM
Quote from: jj2007 on May 30, 2017, 10:30:54 PM
But I had to write a little converter to see your cyrillic comments:

:biggrin:

Why?

Oops, I forgot that everybody should read sources only in their own codepages (http://masm32.com/board/index.php?topic=6221.msg66429#msg66429). So, having an Italian OS, I am not allowed to see cyrillic comments, even if Google would be able to translate it for me, as demonstrated above. Sorry, Sir Nidud, I won't do it again 8)
Title: Re: Uncle Remus Tales
Post by: hutch-- on May 31, 2017, 12:33:46 AM
I downloaded and test it last night but gave up due to exhaustion as I had been awake too long. I could get it to run with VLC but the file was very large and the resolution very low.
Title: Re: Uncle Remus Tales
Post by: jj2007 on May 31, 2017, 01:06:38 AM
VLS runs it, FLV runs it but in distorted black & white.

The file output.avi is 156 MB, no sound, otherwise it wouldn't play with sysanimate32.

The control is very easy to use, just create it and then
invoke SendMessage, hAvi, ACM_OPEN, 0, pFileName
invoke SendMessage, hAvi, ACM_PLAY, -1, 0FFFF0000h


But its usage is really very limited, without sound, and working only with avi files that do not contain sound info.
Attached my dual 64/32-bit version; expects output.avi in the same folder.
Title: Re: Uncle Remus Tales
Post by: nidud on May 31, 2017, 01:35:54 AM
deleted
Title: Re: Uncle Remus Tales
Post by: hutch-- on June 02, 2017, 12:09:21 AM
See if this helps.

Tutorial: Encoding an MP4 File

https://msdn.microsoft.com/en-us/library/windows/desktop/ff819476(v=vs.85).aspx
Title: Re: Uncle Remus Tales
Post by: jj2007 on June 02, 2017, 02:11:29 AM
Almost unrelated:

uselib vfw32
...
invoke MCIWndCreate, hWnd, hInstance, 0, Chr$("chimes.wav")


Can't launch the program because vfw32.dll is not present.

But these files are present:
C:\Windows\SysWOW64\msvfw32.dll
C:\Windows\System32\msvfw32.dll
::)
Title: Re: Uncle Remus Tales
Post by: TWell on June 02, 2017, 02:48:40 AM
check that vfw.lib again.
SDK version of vfw.lib and msvfw.lib use MSVFW32.dll.
MCIWndCreate are in both of those libraries and it is a cdecl type ?

Title: Re: Uncle Remus Tales
Post by: jj2007 on June 02, 2017, 03:12:26 AM
There is no \Masm32\lib\msvfw32.lib, only \Masm32\lib\vfw32.lib
And the latter produces that error message...
Title: Re: Uncle Remus Tales
Post by: TWell on June 02, 2017, 03:18:44 AM
So it is a broken library, make a bug report about it ;)

Correct vfw.lib have references to MSVFW32.DLL AVIFIL32.DLL AVICAP32.DLL
since 1994 ?
Title: Re: Uncle Remus Tales
Post by: jj2007 on June 02, 2017, 05:12:10 AM
Quote from: TWell on June 02, 2017, 03:18:44 AMmake a bug report about it ;)

Like this one (http://www.masmforum.com/board/index.php?topic=4314.0)?  ;)
Title: Re: Uncle Remus Tales
Post by: Siekmanski on June 02, 2017, 05:18:42 AM
try this one.
Title: Re: Uncle Remus Tales
Post by: jj2007 on June 02, 2017, 08:57:57 AM
Nice. I wanted to extract the two files to my "Marinus" folder, and guess what? They were already there :P

Thanks anyway. In the meantime, I tested Pelle's vfw32.lib, it works, too.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 05, 2017, 09:42:17 AM
https://wasm.in/threads/skazki-djadjushki-rimusa.31832/
Title: Re: Uncle Remus Tales
Post by: jj2007 on June 05, 2017, 10:08:53 AM
Thank you, Mikl - this is nicely written, and even in English ;) (https://translate.google.it/translate?sl=ru&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fwasm.in%2Fthreads%2Fskazki-djadjushki-rimusa.31832%2F&edit-text=)
(https://wasm.in/data/avatars/m/7/7954.jpg?1480491213)

Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 20, 2017, 12:47:29 PM
Uncle Remus tales:#14 Process
asm-file
; GUI #
include win64a.inc
include advapi32.inc
includelib advapi32.lib

MI_PROCESS_CREATE equ 0
MI_PROCESS_TERMINATE equ 1
MI_EXIT equ 2
IDR_MAINMENU equ 30
WM_FINISH equ WM_USER+100h
MAX_KEY_LENGTH equ 255
MAX_VALUE_NAME equ 16383
.code
WinMain proc
local msg:MSG

      xor ebx,ebx
mov edi,offset ClassName
mov esi,IMAGE_BASE
mov ecx,offset FileName
invoke LoadCursorFromFile
push rax ;hIconSm
push rdi ;lpszClassName
push IDR_MAINMENU;lpszMenuName
push COLOR_WINDOW;hbrBackground
push 10003h ;hCursor
push rax ;hIcon
push rsi ;hInstance
push rbx ;cbClsExtra & cbWndExtra
pushaddr WndProc;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX
push rbx
push rsi ;rsi=400000h
shl esi,9 ;rsi=CW_USEDEFAULT
push rbx
push rbx
push 200
push 300
push rsi
push rsi
sub esp,20h
    invoke CreateWindowEx,WS_EX_CLIENTEDGE,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
invoke GetMenu,eax
mov hMenu,rax
    lea edi,msg
@@:    invoke GetMessage,edi,0,0,0
invoke DispatchMessage,edi
      jmp @b
WinMain endp

WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local progStartInfo:STARTUPINFO
local hKey:qword
local lpcbData:dword
local hFile:qword
local szBuff[MAX_PATH*4]:byte

mov edi,offset processInfo
mov esi,offset proExitCode
mov hWnd,rcx
mov wParam,r8
mov lParam,r9

cmp  edx,WM_DESTROY
je   wmDESTROY
cmp  edx,WM_CREATE
je   wmCREATE
cmp  edx,WM_COMMAND
je   wmCOMMAND
cmp  edx,WM_INITMENUPOPUP
je   wmINITMENUPOPUP
cmp  edx,WM_FINISH
je   TERMINATE
cmp  edx,WM_TIMER
je   wmTIMER
leave
jmp DefWindowProc

wmDESTROY:invoke GetExitCodeProcess,[rdi+PROCESS_INFORMATION.hProcess],esi;proExitCode
cmp dword ptr [rsi],STILL_ACTIVE
jne @f
invoke TerminateProcess,[rdi+PROCESS_INFORMATION.hProcess],0
@@: invoke CloseHandle,[rdi+PROCESS_INFORMATION.hProcess]
mov [rdi+PROCESS_INFORMATION.hProcess],rbx
invoke ExitProcess,NULL
wmCREATE:
;Узнаем длительность проигрывания wmv-файла
mov [rsp+30h],rbx ;hTemplateFile
mov qword ptr [rsp+28h],FILE_ATTRIBUTE_ARCHIVE ;dwFlagsAndAttributes
mov qword ptr [rsp+20h],OPEN_EXISTING ;dwCreationDisposition
mov ecx,offset FileName1+1    ;lpFileName
invoke CreateFile,,GENERIC_READ,\    ;dwDesiredAccess
FILE_SHARE_READ or FILE_SHARE_WRITE,\;dwShareMode
0 ;lpSecurityAttributes
mov hFile,rax;handle to file
mov [rsp+20h],rbx
lea r9d,lpcbData
lea edi,szBuff
invoke ReadFile,eax,edi,100h
invoke CloseHandle,hFile
 
mov rax,qword ptr szBuff[66h];duration in 100 nSec
mov edx,3518437209
mul edx
shr edx,13
mov duration,rdx;in mSec
;----------------------------------------------------
mov edx,offset aWmv
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,,0,KEY_READ,&hKey
xor esi,esi
@@:     mov lpcbData,MAX_VALUE_NAME
invoke RegEnumValue,hKey,esi,edi,&lpcbData,NULL,NULL,NULL,NULL
or eax,eax
jnz @f
mov lpcbData,100h
mov r9d,offset szREGSZ
invoke RegQueryValueEx,hKey,edi,0,,edi,&lpcbData
add edi,lpcbData
mov eax,[rdi-5]
or eax,20202000h
cmp eax,dword ptr aWmv;'vmw.'
jz @f
inc esi
jmp @b
@@:
;Получаем имя класса------------------------------------------
lea edx,szBuff
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,,0,KEY_READ,&hKey
lea eax,szBuff
add eax,lpcbData
mov dword ptr [rax-1],'ehs\'
mov dword ptr [rax+3],'ll'
invoke RegCloseKey,hKey
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,&szBuff,0,KEY_READ,&hKey
lea eax,lpcbData
mov [rsp+28h],rax
lea eax,szBuff
add eax,lpcbData
mov edi,eax
add edi,6
mov [rsp+20h],rdi
mov lpcbData,MAX_PATH
invoke RegQueryValueEx,hKey,0,0,,,&lpcbData
or word ptr [rdi-1],605Ch;\
mov rax,'dnammoc\'
mov [rdi+4],rax
mov [rdi+12],rbx
invoke RegCloseKey,hKey
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,&szBuff,0,KEY_READ,&hKey
mov lpcbData,MAX_PATH
mov r9d,offset szREGEXPANDSZ
invoke RegQueryValueEx,hKey,0,0,,&szBuff,&lpcbData
invoke RegCloseKey,hKey
lea edi,szBuff
add edi,lpcbData
sub edi,4
invoke GetCurrentDirectory,MAX_PATH,edi
lea edi,[rdi+rax]
mov aWmv[4],'"'
mov esi,offset FileName1
mov ecx,sizeof FileName1+6
rep movsb
lea ecx,szBuff
mov edx,offset szBuff1
invoke ExpandEnvironmentStrings,,,MAX_PATH
jmp wmBYE
wmINITMENUPOPUP:invoke GetExitCodeProcess,[rdi+PROCESS_INFORMATION.hProcess],esi
or eax,eax
jz @f;GetExitCodeProcess_TRUE
cmp dword ptr [rsi],STILL_ACTIVE ;cmp proExitCode,STILL_ACTIVE
jne @f ;     GetExitCodeProcess_STILL_ACTIVE
invoke EnableMenuItem,hMenu,MI_PROCESS_CREATE,MF_GRAYED
xor r8,r8; mov r8d,MF_ENABLED=0
jmp @0
@@: invoke EnableMenuItem,hMenu,MI_PROCESS_CREATE,MF_ENABLED
mov r8d,MF_GRAYED
@0:    invoke EnableMenuItem,hMenu,MI_PROCESS_TERMINATE
jmp wmBYE
wmCOMMAND:movzx eax,word ptr wParam
or r9,r9 ;cmp lParam,0
jnz wmBYE
cmp rax,MI_EXIT
ja wmBYE
jmp  [menu_handlers+rax*8]
PROCESS_CREATE:cmp [rdi+PROCESS_INFORMATION.hProcess],rbx
je pi_hProcess_IS_0
invoke CloseHandle,[rdi+PROCESS_INFORMATION.hProcess]
mov [rdi+PROCESS_INFORMATION.hProcess],rbx
pi_hProcess_IS_0:lea esi,progStartInfo
invoke GetStartupInfo,esi
invoke CreateProcess,0,&szBuff1,\
0,\;process security attributes
0,\;primary thread security attributes
0,\;handles are inherited
NORMAL_PRIORITY_CLASS,\;creation flags
0,\;use parent's environment
0,\;use parent's current directory
rsi,\;STARTUPINFO pointer
rdi ;receives PROCESS_INFORMATION
invoke CloseHandle,[rdi+PROCESS_INFORMATION.hThread]
invoke SetTimer,hWnd,1,duration,0
jmp wmBYE
TERMINATE:invoke GetExitCodeProcess,[rdi+PROCESS_INFORMATION.hProcess],esi;proExitCode
cmp dword ptr [rsi],STILL_ACTIVE
jne proExitCode_NOT_STILL_ACTIVE;a4;
invoke TerminateProcess,[rdi+PROCESS_INFORMATION.hProcess],0
proExitCode_NOT_STILL_ACTIVE:
invoke CloseHandle,[rdi+PROCESS_INFORMATION.hProcess]
mov [rdi+PROCESS_INFORMATION.hProcess],rbx;0
invoke PostMessage,hWnd,WM_INITMENUPOPUP,NULL,NULL
invoke KillTimer,hWnd,1
jmp wmBYE
wmTIMER:invoke PostMessage,,WM_FINISH,0,0
jmp wmBYE
EXIT: invoke DestroyWindow
wmBYE:  leave
retn
menu_handlers dq PROCESS_CREATE, TERMINATE, EXIT
WndProc endp
;---------------------------------------
ClassName       db 'Uncle Remus tales:#14 Process',0
hMenu dq ?
proExitCode dq ?;process exit code
FileName db "..\Images\br_Rabbit3.cur",0
szREGSZ db 'REG_SZ',0
szREGEXPANDSZ db 'REG_EXPAND_SZ',0
FileName1 db '\movie3'
aWmv db '.wmv',0,0
processInfo PROCESS_INFORMATION <>
szBuff1 db MAX_PATH dup(?)
duration dq ?
end
rc-file#define MI_PROCESS_CREATE 0
#define MI_PROCESS_TERMINATE 1
#define MI_EXIT 2
#define IDR_MAINMENU 30

IDR_MAINMENU MENU
{
POPUP "&Process"
        {
         MENUITEM "&Create Process",MI_PROCESS_CREATE
         MENUITEM "&Terminate Process",MI_PROCESS_TERMINATE,GRAYED
         MENUITEM SEPARATOR
         MENUITEM "E&xit",MI_EXIT
        }
}
bat-filecls
set masm64_path=\masm56\
set filename=%~n1
call :read_settings %filename%
@echo %kind_of_file%
goto %kind_of_file%
:GUI
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%\bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj %filename%.res >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
del errors.txt
exit
:DLL
if exist %filename%.dll del %filename%.dll
%masm64_path%bin\ml64 /c /Cp /I %masm64_path%include %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r  %filename%.rc >> errors.txt
if errorlevel 1 exit
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj %filename%.res /DEF:%filename%.def >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj /DEF:%filename%.def >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
del %filename%.exp
del errors.txt
exit
:read_settings
for /f "eol=# tokens=2-3" %%A in (%filename%.asm) do (
set kind_of_file=%%A
if %%B == # exit /b )
exit /b
There is movie3.wmv (https://yadi.sk/d/vQaulzqV3KHGMP) in same folder with exe-file
Title: Re: Uncle Remus Tales
Post by: hutch-- on June 20, 2017, 03:27:34 PM
Mikl,

What are you zipping these files with ? I could unzip the first one but the 00.zip cannot be unzipped with WinRar.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 20, 2017, 04:16:21 PM
Hi, hutch-- !
I used 7-zip menager (www.7-zip.org) compression method deflate, compression level maximum, dictionary size 32 KB, word size 64
And I used WinZip and produced NewZip.zip now
Title: Re: Uncle Remus Tales
Post by: hutch-- on June 21, 2017, 01:57:14 AM
I could download the asm file and exe file with no problems but the 00.zip file keeps giving the error message "unknown format or damaged".
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 21, 2017, 02:09:35 AM
hutch--,
Only files with Zip extension can be uploaded to your site. File 00.zip is a renamed file 00.png the browser knows about it and shows the correct picture with the wrong extension. I thought that you know about the features of your site
Title: Re: Uncle Remus Tales
Post by: hutch-- on June 21, 2017, 02:42:49 AM
I renamed the file to ".png" and can view the image but the exe does not run.

The suggestion, put it all together as one zip file making sure it works properly and post it so we can see what it does.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 21, 2017, 03:05:22 AM
hutch--,
download 14.zip and extract it in same folder with movie3.wmv
Title: Re: Uncle Remus Tales
Post by: hutch-- on June 21, 2017, 10:53:16 AM
Done, exe does not run. I can open the wmv file and it runs with VLC player. I am running Win10 64 US version.
Title: Re: Uncle Remus Tales
Post by: jj2007 on June 21, 2017, 05:42:24 PM
On Win7-64, exe runs fine, but the process starts only if there is moview3.wmv in the same folder.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 21, 2017, 06:46:44 PM
14.zip (6.12 kB - downloaded 20 times.)
jj2007 + hutch-- + caballero = 3
How did the program workes for another 17 men?
Title: Re: Uncle Remus Tales
Post by: avcaballero on June 21, 2017, 07:06:15 PM
Hi Mikl, 7 now, I executed the tut_14-04.exe with movie3.wmv in the same folder, but nothing happened except that it remains as a process. W7 64 bits.
Title: Re: Uncle Remus Tales
Post by: avcaballero on June 21, 2017, 07:25:18 PM
What it should do, play movies using mci? I made a multimedia player some years ago with fasm, I attach two version, the extended one is MP3WF01 and works ok with it, the MP3WF03 is a tiny version, when you open the file with it you can view it with the previous player, but when you click on accept cannot play it, I have to check it.

EDITED: The problem is the window size that doesn't allow to view the buttons to play it, if you put
cdXSize            equ  640
cdYSize            equ  440
for example, it wuould be nice
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 22, 2017, 09:11:37 AM
Hi, hutch-- and caballero!
Do you have a key .wmv in HKEY_CLASSES_ROOT? If there is the key, can you write the contents of HKEY_CLASSES_ROOT\.wmv names, types and values?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 24, 2017, 11:53:36 AM
QuoteWhat it should do, play movies using mci?
Hi, caballero!
See
And you will write about branch registry contents HKEY_CLASSES_ROOT\.wmv names, types and values,  pleazzz..  This is necessary for correct errors in tut_14-04.exe
Title: Re: Uncle Remus Tales
Post by: jj2007 on June 24, 2017, 02:11:02 PM
Quote from: Mikl__ on June 24, 2017, 11:53:36 AM
And you will write about branch registry contents HKEY_CLASSES_ROOT\.wmv names, types and values,  pleazzz..  This is necessary for correct errors in tut_14-04.exe

Here is mine :icon14:
Title: Re: Uncle Remus Tales
Post by: avcaballero on June 24, 2017, 04:58:48 PM
I write this from another computer than the first time. Now, the window is up but seems not working. Here is my wmv register branch, as I see I need to clean it better because I dont' have winamp yet. What I don't know is why is this info good for you.

Quote
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.wmv]
@="Winamp3.File"
"PerceivedType"="video"
"Content Type"="video/x-ms-wmv"
"VLC.backup"="WMP11.AssocFile.WMV"
"Winamp_Back"="Winamp.File.WMV"

[HKEY_CLASSES_ROOT\.wmv\OpenWithList]

[HKEY_CLASSES_ROOT\.wmv\OpenWithList\ehshell.exe]

[HKEY_CLASSES_ROOT\.wmv\OpenWithProgIds]
"WMP11.AssocFile.WMV"=hex(0):
"WindowsLive.PhotoGallery.video.15.4"=""
"WindowsLive.MovieMaker.asset"=hex:

[HKEY_CLASSES_ROOT\.wmv\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.wmv\ShellEx]

[HKEY_CLASSES_ROOT\.wmv\ShellEx\{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{9DBD2C50-62AD-11D0-B806-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.wmv\ShellEx\{e357fccd-a995-4576-b01f-234630154e96}]
@="{9DBD2C50-62AD-11D0-B806-00C04FD706EC}"
Title: Re: Uncle Remus Tales
Post by: TWell on June 24, 2017, 05:35:16 PM
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.wmv]
@="WMP11.AssocFile.WMV"
"Content Type"="video/x-ms-wmv"
"PerceivedType"="video"

[HKEY_CLASSES_ROOT\.wmv\OpenWithProgids]
"WMP11.AssocFile.WMV"=hex(0):
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 24, 2017, 08:49:33 PM
hi, TWell and caballero!
you haveHKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\Play\command\"%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" /prefetch:7 /Play "%L"but tut_14-04.exe not runs?
Title: Re: Uncle Remus Tales
Post by: TWell on June 25, 2017, 12:11:27 AM
crash at 0040037A, Exception: Access violation
   invoke ReadFile,eax,edi,100h
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 25, 2017, 12:45:25 AM
TWell
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local progStartInfo:STARTUPINFO
local hKey:qword
local lpcbData:dword
local hFile:qword
local szBuff[MAX_PATH*4]:byte
local old_rdi:qword
local old_rsi:qword

mov old_rdi,rdi
mov old_rsi,rsi
        . . . .
wmCREATE: . . .
lea edx,szBuff
invoke ReadFile,eax,,100h
        . . . .
wmBYE:  mov rdi,old_rdi
mov rsi,old_rsi
leave
retn
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 13, 2017, 03:22:22 PM
asm-file; GUI #
include win64a.inc
include advapi32.inc
includelib advapi32.lib

MI_PROCESS_CREATE equ 0
MI_PROCESS_TERMINATE equ 1
MI_EXIT equ 2
IDR_MAINMENU equ 30
WM_FINISH equ WM_USER+100h
MAX_KEY_LENGTH equ 255
MAX_VALUE_NAME equ 16383
.code
WinMain proc
local msg:MSG

      xor ebx,ebx
mov edi,offset ClassName
mov esi,IMAGE_BASE
mov ecx,offset FileName
invoke LoadCursorFromFile
push rax ;hIconSm
push rdi ;lpszClassName
push IDR_MAINMENU;lpszMenuName
push COLOR_WINDOW;hbrBackground
push 10003h ;hCursor
push rax ;hIcon
push rsi ;hInstance
push rbx ;cbClsExtra & cbWndExtra
pushaddr WndProc;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX
push rbx
push rsi ;rsi=400000h
shl esi,9 ;rsi=CW_USEDEFAULT
push rbx
push rbx
push 200
push 300
push rsi
push rsi
sub esp,20h
    invoke CreateWindowEx,WS_EX_CLIENTEDGE,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
invoke GetMenu,eax
mov hMenu,rax
    lea edi,msg
@@:    invoke GetMessage,edi,0,0,0
invoke DispatchMessage,edi
      jmp @b
WinMain endp

WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local progStartInfo:STARTUPINFO
local hKey:qword
local lpcbData:dword
local lpType:dword
local hFile:qword
local szBuff[MAX_PATH*4]:byte
local old_rdi:qword
local old_rsi:qword

mov hWnd,rcx
mov wParam,r8
mov lParam,r9
mov old_rdi,rdi
        mov old_rsi,rsi

cmp  edx,WM_DESTROY
je   wmDESTROY
cmp  edx,WM_CREATE
je   wmCREATE
cmp  edx,WM_COMMAND
je   wmCOMMAND
cmp  edx,WM_INITMENUPOPUP
je   wmINITMENUPOPUP
cmp  edx,WM_FINISH
je   TERMINATE
cmp  edx,WM_TIMER
je   wmTIMER
leave
jmp DefWindowProc

wmDESTROY:invoke GetExitCodeProcess,processInfo.hProcess,esi;proExitCode
cmp dword ptr proExitCode,STILL_ACTIVE
jne @f
invoke TerminateProcess,processInfo.hProcess,0
@@: invoke CloseHandle,processInfo.hProcess
mov processInfo.hProcess,rbx
invoke ExitProcess,NULL
wmCREATE:
;get the length of playing a wmv-file
mov [rsp+30h],rbx ;hTemplateFile
mov qword ptr [rsp+28h],FILE_ATTRIBUTE_ARCHIVE ;dwFlagsAndAttributes
mov qword ptr [rsp+20h],OPEN_EXISTING ;dwCreationDisposition
mov ecx,offset FileName1+1    ;lpFileName
invoke CreateFile,,GENERIC_READ,\    ;dwDesiredAccess
FILE_SHARE_READ or FILE_SHARE_WRITE,\;dwShareMode
0 ;lpSecurityAttributes
mov hFile,rax;handle to file
mov [rsp+20h],rbx
lea r9d,lpcbData
lea edi,szBuff
invoke ReadFile,eax,edi,100h
invoke CloseHandle,hFile
mov rax,qword ptr szBuff[66h];duration in 100 nSec
;Duration in 100nSec-units is divided by 10000 and get in duration in 1mSec-units
mov edx,3518437209;"magic number"
mul edx
shr edx,13
mov duration,rdx;in mSec
;----------------------------------------------------
;Open the section HKEY_CLASSES_ROOT\.wmv\OpenWithProgids
mov edx,offset aWmv1
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,,0,KEY_READ,&hKey
        or eax,eax
jnz bad0
xor esi,esi
; inc esi
@@:     mov lpcbData,MAX_VALUE_NAME
invoke RegEnumValue,hKey,esi,edi,&lpcbData,NULL,&lpType,NULL,NULL
;HKEY hKey, // A handle to an open registry key
;DWORD dwIndex,=esi // The index of the value to be retrieved
;LPTSTR lpValueName,edi=&szBuff // A pointer to a buffer that receives the name of the value as a null-terminated string
;LPDWORD lpcbValueName,=&lpcbData // A pointer to a variable that specifies the size of the buffer pointed to by the lpValueName parameter, in characters
;LPDWORD lpReserved,=0 // This parameter is reserved and must be NULL.
;LPDWORD lpType,=&lpType // A pointer to a variable that receives a code indicating the type of data stored in the specified value
;LPBYTE lpData,=0 // A pointer to a buffer that receives the data for the value entry
;LPDWORD lpcbData,=&lpcbData // A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes
or eax,eax
jnz bad1;Until we get all the keys HKEY_CLASSES_ROOT\.wmv\OpenWithProgids
;Looking for a key with an end on .wmv
        cmp lpcbData,5;The string is longer than ".wmv" ?
jb a1; To the next line
mov eax,edi
add eax,lpcbData;Go to the end of the line
mov eax,[rax-4]
or eax,20202000h;We give an extension to the lower case
cmp eax,dword ptr aWmv;это ".wmv" ?
jz @f
a1: inc esi
jmp @b
bad0:   invoke MessageBox,0,&error0,&ClassName,MB_OK
jmp wmDESTROY
bad1:;Closed the section HKEY_CLASSES_ROOT\.wmv\OpenWithProgids
invoke RegCloseKey,hKey
invoke MessageBox,0,&error1,&ClassName,MB_OK
jmp wmDESTROY
@@:;Closed the section HKEY_CLASSES_ROOT\.wmv\OpenWithProgids
invoke RegCloseKey,hKey
;Get the name mplayerc.wmv or WMP11.AssocFile.WMV
;Make of it HKEY_CLASSES_ROOT\mplayerc.wmv\shell
;or HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell
add edi,lpcbData
cmp lpType,REG_SZ
jne @f
dec edi
@@: mov dword ptr [rdi],'ehs\'
mov dword ptr [rdi+4],'ll'
lea edx,szBuff
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,,0,KEY_READ,&hKey
;Read the meaning HKEY_CLASSES_ROOT\mplayerc.wmv\shell = open
;or        HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell = Play
        lea eax,lpcbData
mov [rsp+28h],rax
add edi,7;Length of string "\shell\"
mov [rsp+20h],rdi
mov lpcbData,MAX_PATH
invoke RegQueryValueEx,hKey,0,0,,edi,&lpcbData
;Closed the section HKEY_CLASSES_ROOT\mplayerc.wmv\shell
;   or  HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell
invoke RegCloseKey,hKey
;Open the section HKEY_CLASSES_ROOT\mplayerc.wmv\shell\open\command
;or       HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\play\command
or word ptr [rdi-1],605Ch;"\"+ lower case
mov rax,'dnammoc\'
mov [rdi+4],rax
mov [rdi+12],rbx
invoke RegOpenKeyEx,HKEY_CLASSES_ROOT,&szBuff,0,KEY_READ,&hKey
;Read the meaning HKEY_CLASSES_ROOT\mplayerc.wmv\shell\open\command
;"C:\Program Files (x86)\Combined Community Codec Pack\MPC\mpc-hc.exe" "%1"
;     or HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\play\command
;"%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" /prefetch:7 /Play "%L"
mov lpcbData,MAX_PATH
lea r9d,lpType
invoke RegQueryValueEx,hKey,0,0,,&szBuff,&lpcbData
;Closed the section HKEY_CLASSES_ROOT\mplayerc.wmv\shell\open\command
;    or HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\play\command
invoke RegCloseKey,hKey
lea edi,szBuff
add edi,lpcbData
sub edi,4
invoke GetCurrentDirectory,MAX_PATH,edi
lea edi,[rdi+rax]
mov aWmv[4],'"'
mov esi,offset FileName1
mov ecx,sizeof FileName1+6
rep movsb
lea ecx,szBuff
mov edx,offset szBuff1
invoke ExpandEnvironmentStrings,,,MAX_PATH
jmp wmBYE
wmINITMENUPOPUP:mov edx,offset proExitCode
invoke GetExitCodeProcess,processInfo.hProcess
or eax,eax
jz @f;GetExitCodeProcess_TRUE
cmp dword ptr proExitCode,STILL_ACTIVE ;cmp proExitCode,STILL_ACTIVE
jne @f ;     GetExitCodeProcess_STILL_ACTIVE
invoke EnableMenuItem,hMenu,MI_PROCESS_CREATE,MF_GRAYED
xor r8,r8; mov r8d,MF_ENABLED=0
jmp @0
@@: invoke EnableMenuItem,hMenu,MI_PROCESS_CREATE,MF_ENABLED
mov r8d,MF_GRAYED
@0:    invoke EnableMenuItem,hMenu,MI_PROCESS_TERMINATE
jmp wmBYE
wmCOMMAND:movzx eax,word ptr wParam
or r9,r9 ;cmp lParam,0
jnz wmBYE
cmp rax,MI_EXIT
ja wmBYE
jmp  [menu_handlers+rax*8]
PROCESS_CREATE:cmp processInfo.hProcess,rbx
je pi_hProcess_IS_0
invoke CloseHandle,processInfo.hProcess
mov processInfo.hProcess,rbx
pi_hProcess_IS_0:lea esi,progStartInfo
invoke GetStartupInfo,esi
invoke CreateProcess,0,&szBuff1,\
0,\;process security attributes
0,\;primary thread security attributes
0,\;handles are inherited
NORMAL_PRIORITY_CLASS,\;creation flags
0,\;use parent's environment
0,\;use parent's current directory
rsi,\;STARTUPINFO pointer
&processInfo ;receives PROCESS_INFORMATION
invoke CloseHandle,processInfo.hThread
invoke SetTimer,hWnd,1,duration,0
jmp wmBYE
TERMINATE:mov edx,offset proExitCode
invoke GetExitCodeProcess,processInfo.hProcess
cmp dword ptr proExitCode,STILL_ACTIVE
jne proExitCode_NOT_STILL_ACTIVE;a4;
invoke TerminateProcess,processInfo.hProcess,0
proExitCode_NOT_STILL_ACTIVE:
invoke CloseHandle,processInfo.hProcess
mov processInfo.hProcess,rbx;0
invoke PostMessage,hWnd,WM_INITMENUPOPUP,NULL,NULL
invoke KillTimer,hWnd,1
jmp wmBYE
wmTIMER:invoke PostMessage,,WM_FINISH,0,0
jmp wmBYE
EXIT: invoke DestroyWindow
wmBYE:  mov rdi,old_rdi
        mov rsi,old_rsi
leave
retn
menu_handlers dq PROCESS_CREATE, TERMINATE, EXIT
WndProc endp
;---------------------------------------
.data
ClassName       db 'Uncle Remus tales:#14 Process',0
hMenu dq ?
proExitCode dq ?;process exit code
FileName db "..\Images\br_Rabbit3.cur",0
FileName1 db '\movie3'
aWmv db '.wmv',0,0
aWmv1           db '.wmv\OpenWithProgids',0
processInfo PROCESS_INFORMATION <>
szBuff1 db MAX_PATH dup(?)
duration dq ?
error0 db "No section HKEY_CLASSES_ROOT\.wmv\OpenWithProgids",0
error1 db "Did not find the application that plays the wmv-files",0
end
rc-file#define MI_PROCESS_CREATE 0
#define MI_PROCESS_TERMINATE 1
#define MI_EXIT 2

#define IDR_MAINMENU 30

IDR_MAINMENU MENU
{
POPUP "&Process"
        {
         MENUITEM "&Create Process",MI_PROCESS_CREATE
         MENUITEM "&Terminate Process",MI_PROCESS_TERMINATE,GRAYED
         MENUITEM SEPARATOR
         MENUITEM "E&xit",MI_EXIT
        }
}
movie3.wmv (https://yadi.sk/d/vQaulzqV3KHGMP)
Title: Re: Uncle Remus Tales
Post by: jj2007 on July 13, 2017, 05:05:33 PM
lea eax,lpcbData

You rely on zero-extension, right?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 13, 2017, 09:53:33 PM
Buona sera, signore jj2007!
The program doesn't play the wmv-file again?
Title: Re: Uncle Remus Tales
Post by: jj2007 on July 13, 2017, 10:56:29 PM
Добрый вечер, Майкл!

It plays, sure. I just wonder if your uses of 32-bit registers for pointers are safe. Is the stack guaranteed to be in 32-bit land?
        lea eax,lpcbData
mov [rsp+28h],rax
add edi,7;Length of string "\shell\"
mov [rsp+20h],rdi
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 13, 2017, 11:03:16 PM
The use of 32-bit registers with their zero extension in 64-bit and 32-bit addresses with /LARGEADDRESSAWARE:NO is just a way to make the tiny size program (https://wasm.in/styles/smiles_s/smile3.gif) I create my exe-/dll-/sys-files using bat-file cls
set masm64_path=c:\masm64\
set filename=%~n1

call :read_settings %filename%
@echo %kind_of_file%
goto %kind_of_file%
:GUI
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%\bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj %filename%.res >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
del errors.txt
exit
:DLL
if exist %filename%.dll del %filename%.dll
%masm64_path%bin\ml64 /c /Cp /I %masm64_path%include %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r  %filename%.rc >> errors.txt
if errorlevel 1 exit
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj %filename%.res /DEF:%filename%.def >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj /DEF:%filename%.def >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
del %filename%.exp
del errors.txt
exit
:read_settings
for /f "eol=# tokens=2-3" %%A in (%filename%.asm) do (
set kind_of_file=%%A
if %%B == # exit /b )
exit /b
jj2007,
Do You live in Italy and try not to use Italian?
Title: Re: Uncle Remus Tales
Post by: jj2007 on July 13, 2017, 11:32:17 PM
OK, so you need the linker option. The result will be a bit like x32 ABI (https://en.wikipedia.org/wiki/X32_ABI) :biggrin:

Quote from: Mikl__ on July 13, 2017, 11:03:16 PMDo You live in Italy and try not to use Italian?

Yes, I live here, and use 4 languages every day, including Italian, of course 8)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 13, 2017, 11:43:59 PM
In my programs there is no need to use 48- or 64-bit addressing.
I taught myself Italian. Then there were no Google-translators. I just do not have enough practice.
Title: Re: Uncle Remus Tales
Post by: jj2007 on July 13, 2017, 11:48:39 PM
C'è un solo modo valido per imparare l'italiano: praticarlo con una bella italiana :biggrin:
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 13, 2017, 11:53:47 PM
imparare qualsiasi lingua è utile con una bella interprete sul cuscino (http://www.kolobok.us/smiles/artists/vishenka/d_martini.gif)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 15, 2017, 02:34:07 AM
Quote(http://masm32.com/board/Themes/default/images/icons/clip.gif)14.zip (7.1 kB - downloaded 64 times.)
one is jj2007 he has workig program, I'm interested - 63 men have workig program or they have unworking program?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 16, 2017, 10:55:10 AM
It looks like some robot trains in downloading a file. Yesterday there were 64 downloads, today 128 and no comments about the program
Title: Re: Uncle Remus Tales
Post by: HSE on July 16, 2017, 11:09:57 AM
The robot only like 64bit. ¿? 

Number is similar to your other files, perhaps somebody is teaching with your files.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on July 16, 2017, 12:22:50 PM
Quoteperhaps somebody is teaching with your files
Hi, HSE!
It seems that this is a school class. (https://wasm.in/styles/smiles_s/mosking.gif) I think that one person would download the file once or twice. Worse, that with the one who downloads there is no feedback.
Quote14.zip (7.1 kB - downloaded 258 times.)
It is only robot
Title: Re: Uncle Remus Tales
Post by: jj2007 on July 16, 2017, 05:05:30 PM
Or a really big school class ;)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 03, 2017, 02:41:10 PM
Sticky drawing
rc-fileMYBP1 BITMAP tar_baby.bmpasm-file; GUI #
include win64a.inc
.code
WinMain proc
local msg:MSG

    xor ebx,ebx
    mov esi,IMAGE_BASE
    mov ecx,offset FileName
invoke LoadCursorFromFile
    mov edi,offset ClassName

    push rax    ;hIconSm
    push rdi    ;lpszClassName
    push rbx    ;lpszMenuName
    push COLOR_WINDOW+1;hbrBackground
    push 10003h ;hCursor
    push rax    ;hIcon
    push rsi    ;hInstance
    push rbx    ;cbClsExtra & cbWndExtra
    pushaddr WndProc      ;lpfnWndProc
    push sizeof WNDCLASSEX;cbSize & style
    invoke RegisterClassEx,esp    ;addr WNDCLASSEX 

    push rbx
    push rsi    ;rsi=400000h
    shl esi,9   ;rsi=CW_USEDEFAULT
    push rbx
    push rbx
    push rsi
    push rsi
    push rsi
    push rsi
    sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE

    lea edi,msg
@@: invoke GetMessage,edi,0,0,0
    invoke DispatchMessage,edi
    jmp @b
WinMain endp
WndProc proc hwnd:QWORD,uMsg:QWORD,wParam:QWORD,lParam:QWORD
mov hwnd,rcx   

cmp edx,WM_CREATE
je wmCREATE
cmp edx,WM_DESTROY
je wmDESTROY
cmp edx,WM_PAINT
je wmPAINT
cmp dx,WM_MOUSEMOVE
je wmMOUSEMOVE
leave
jmp NtdllDefWindowProc_

wmDESTROY:invoke ReleaseDC,hwnd,DC
invoke DeleteDC,memDC
invoke DeleteObject,hBit1
invoke RtlExitUserProcess,NULL
wmCREATE:mov edx,offset aMYBP
invoke LoadBitmap,IMAGE_BASE
mov hBit1,rax
        invoke GetDC,hwnd
mov DC,rax
invoke CreateCompatibleDC,eax;DC
        mov memDC,rax
invoke SelectObject,eax,hBit1
jmp  wmBYE
wmMOUSEMOVE:;low order lParam  = x    high order lParam = y
mov word ptr expHPoint.x,r9w
shr r9,16
mov expHPoint.y,r9d
mov r8b,TRUE
invoke InvalidateRect,,0;,TRUE
jmp  wmBYE
wmPAINT:mov r8d,expHPoint.y
sub r8d,50
    mov edx,expHPoint.x
sub edx,50
    invoke BitBlt,DC,,,164,206,memDC,rbx,rbx,SRCCOPY
wmBYE: leave
retn
WndProc endp
;---------------------------------------
ClassName db "Uncle Remus tales:#6c Tar baby",0
expHPoint POINT <0>
FileName db "br_Rabbit3.cur",0
hBit1 HBITMAP ?
aMYBP db "MYBP1",0
memDC HDC ?
DC HDC ?
end
There are rc/asm/exe/ico/bmp/bat-files in 06.zip file
If you do not know who it is, then look at the picture and remember the tale of "brother rabbit, brother fox and tar baby"
Title: Re: Uncle Remus Tales
Post by: jj2007 on August 03, 2017, 05:19:13 PM
Nice example :t

invoke BitBlt,DC,,,164,206,memDC,rbx,rbx,SRCCOPY  ::)

Interesting syntax - is that an invoke macro, or a new UAsm feature? And what is pushaddr WndProc?

Btw where is this file: Error A2106: Cannot open file: "win64a.inc"?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 03, 2017, 05:43:07 PM
Buon giorno, amico jj2007!
Questo file è per te
P.S. è il caldo in Italia?
Title: Re: Uncle Remus Tales
Post by: jj2007 on August 03, 2017, 07:05:12 PM
Buongiorno amico Mikl :icon14:

Si, fa molto caldo qui - 35 gradi+

Unfortunately, I get plenty of such errors:
\Masm32\Include64\temphls.inc(965) : Error A2200: Syntax error in control-flow directive
\Masm32\Include64\temphls.inc(965): Included by
  win64a.inc(2): Included by
   Tmp_File.asm(3): Main line code
\Masm32\Include64\temphls.inc(968) : Error A2210: Syntax error: J_POLY_COND
\Masm32\Include64\temphls.inc(968): Included by
  win64a.inc(2): Included by
   Tmp_File.asm(3): Main line code
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 24, 2017, 11:42:04 PM
tut_035-06.rc#include "resource.h"
#define IDR_MAINMENU                    101
#define IDD_OPTIONDLG                   101
#define IDD_GOTODLG                     102
#define IDR_MAINACCEL                   103

#define IDC_BACKCOLORBOX                1000
#define IDC_TEXTCOLORBOX                1001
#define IDC_OK 1002
#define IDC_CANCEL 1003
#define IDC_LINENO                      1004
#define IDM_OPEN                        40001
#define IDM_SAVE                        40002
#define IDM_CLOSE                       40003
#define IDM_SAVEAS                      40004
#define IDM_EXIT                        40005
#define IDM_COPY                        40006
#define IDM_CUT                         40007
#define IDM_PASTE                       40008
#define IDM_DELETE                      40009
#define IDM_SELECTALL                   40010
#define IDM_OPTION                      40011
#define IDM_UNDO                        40012
#define IDM_REDO                        40013
#define IDM_FIND                        40014
#define IDM_FINDNEXT                    40015
#define IDM_REPLACE                     40016
#define IDM_GOTOLINE                    40017
#define IDM_FINDPREV                    40018
#define IDC_ICON1    500

IDC_ICON1 ICON "..\\Images\\br_Fox1.ico"
IDR_MAINMENU MENU DISCARDABLE
{
    POPUP "&File"
    {
        MENUITEM "&Open\tCtrl+O",               IDM_OPEN
        MENUITEM "Close\tCtrl+W",               IDM_CLOSE
        MENUITEM "&Save\tCtrl+S",               IDM_SAVE
        MENUITEM "Save As\tF12",                IDM_SAVEAS
        MENUITEM SEPARATOR
        MENUITEM "Exit\tAlt+F4",                IDM_EXIT
    }
    POPUP "&Edit"
    {
        MENUITEM "Undo\tCtrl+Z",                IDM_UNDO
        MENUITEM "Redo\tCtrl+Y",                IDM_REDO
        MENUITEM "&Copy\tCtrl+C",               IDM_COPY
        MENUITEM "Cut\tCtrl+X",                 IDM_CUT
        MENUITEM "Paste\tCtrl+V",               IDM_PASTE
        MENUITEM SEPARATOR
        MENUITEM "Delete\tDel",                 IDM_DELETE
        MENUITEM SEPARATOR
        MENUITEM "Select &All\tCtrl+A",         IDM_SELECTALL
    }
    POPUP "&Search"
    {
        MENUITEM "&Find...\tCtrl+F",            IDM_FIND
        MENUITEM "Find &Next\tF3",              IDM_FINDNEXT
        MENUITEM "Find &Prev\tCtrl+F3",        IDM_FINDPREV
        MENUITEM "&Replace...\tCtrl+R",          IDM_REPLACE
        MENUITEM SEPARATOR
        MENUITEM "&Go To Line\tCtrl+G",         IDM_GOTOLINE
    }
    MENUITEM "&Options",                         IDM_OPTION
}


IDD_OPTIONDLG DIALOG DISCARDABLE  0, 0, 183, 54
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Options"
FONT 8, "MS Sans Serif"
{
    DEFPUSHBUTTON   "OK",IDC_OK,137,7,39,14
    PUSHBUTTON      "Cancel",IDC_CANCEL,137,25,39,14
    GROUPBOX        "",IDC_STATIC,5,0,124,49
    LTEXT           "Background Color:",IDC_STATIC,20,14,60,8
    LTEXT           "",IDC_BACKCOLORBOX,85,11,28,14,SS_NOTIFY | WS_BORDER
    LTEXT           "Text Color:",IDC_STATIC,20,33,35,8
    LTEXT           "",IDC_TEXTCOLORBOX,85,29,28,14,SS_NOTIFY | WS_BORDER
}

IDD_GOTODLG DIALOGEX 0, 0, 106, 30
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Перейти на строку"
FONT 8, "MS Sans Serif", 0, 0, 1
{
    EDITTEXT        IDC_LINENO,32,4,30,11,ES_AUTOHSCROLL | ES_NUMBER,
                    WS_EX_CLIENTEDGE
    DEFPUSHBUTTON   "OK",IDOK,70,4,31,11
    PUSHBUTTON      "Отмена",IDCANCEL,70,17,31,11
    LTEXT           "Строка:",IDC_STATIC,1,5,30,8
}

IDR_MAINACCEL ACCELERATORS DISCARDABLE
{  // определение акселераторов
"^O",IDM_OPEN
"^W",IDM_CLOSE
"^S",IDM_SAVE
VK_F12,IDM_SAVEAS,VIRTKEY
"^F",IDM_FIND
"^G",IDM_GOTOLINE
"^R",IDM_REPLACE
VK_F3,IDM_FINDNEXT,VIRTKEY
VK_F3,IDM_FINDPREV,VIRTKEY,CONTROL
}
asm/ico/cur/rc/exe-files in attach
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 26, 2017, 07:54:15 PM
Tiny IDE
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 27, 2017, 02:34:33 AM
Files in the archive have been downloaded 71 times, and nobody asks about the files content in the archive. It is very strange... These are mail-bots! (https://wasm.in/styles/smiles_s/mosking.gif)
Wow! File 36.zip was downloaded 140 times... Maybe somewhere installed a mirror site of this web-page
Title: Re: Uncle Remus Tales
Post by: mineiro on August 27, 2017, 09:22:06 PM
hello Mikl___
I have tried 35 and 36 files on linux under wine and received an error message. Sounds to me that wine don't have that function being called implemented but that's a default function so this is why I'm posting. What I'm thinking is just a function name convention I suppose (not sure). I don't know if you like to do that program wine compatible. I don't have windows on my machine this is why I don't have tried on windows ok.
This is the error I'm receiving, number 35 have same error on same function and same memory address in my machine:
:~/.wine/drive_c/36$ wine tut_36.exe
wine: Call from 0x7f53e39fce38 to unimplemented function ntdll.dll.NtdllDefWindowProc_A, aborting
wine: Unimplemented function ntdll.dll.NtdllDefWindowProc_A called at address 0x7f53e39fce38 (thread 0024), starting debugger...
When I dump disassembled tut_36.exe to see headers sections I found this (other functions are omited):
        2d0e      567  NtdllDefWindowProc_A

If you have intentions to do this wine compatible I can do some tests on my machine.

--Oh, I forgot to say, this is just a first view, I'm investigating this on my machine to see if it is a wine error ok. So, your example can be right and the function is really not implemented on wine.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 27, 2017, 10:26:15 PM
Olá Mineiro! No meu Windows 7 x64 existem
NTDLL.RtlExitUserProcess é redirecionado para Kernel32.ExitProcess
NTDLL.NtdllDialogWndProc_A é redirecionado para User32.DefDlgProcA
NTDLL.NtdllDefWindowProc_A é redirecionado para User32.DefWindowProcA
Eu pensei que era melhor chamar as funções diretamente de NTDLL.dll e não através das absorvente-funções. Estou usando um bat-fileset FileName=user32
dumpbin.exe /EXPORTS %windir%\System32\%FileName%.dll /OUT:%FileName%.txt

Title: Re: Uncle Remus Tales
Post by: jj2007 on June 05, 2018, 06:04:38 PM
Hi Fridebot, welcome to the forum :greensml:
Title: Re: Uncle Remus Tales
Post by: zedd151 on June 05, 2018, 06:06:29 PM
Quote from: jj2007 on June 05, 2018, 06:04:38 PM
Hi Fridebot, welcome to the forum :greensml:

me too.  :badgrin:

Should learn proper English syntax.

They should be careful which threads  they post in  (http://masm32.com/board/index.php?topic=7179.msg77956#msg77956)

Frideborg will be a FriedBorg.   :greensml:
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 05, 2018, 10:22:25 PM
I was glad that someone came to talk in my topic. But it was just a bot (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
Title: Re: Uncle Remus Tales
Post by: zedd151 on June 06, 2018, 02:20:53 AM
Quote from: Mikl__.... But it was just a bot (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)

Hey,  we showed up too...    :icon_mrgreen:
Title: Re: Uncle Remus Tales
Post by: Mikl__ on June 06, 2018, 08:03:45 AM
Hi, zedd151!
I'm glad to see you again
Title: Re: Uncle Remus Tales
Post by: zedd151 on June 06, 2018, 08:26:19 AM
Just for the record I downloaded movie 01-04, renamed zips  and extracted movie.gif.  so what's the next step?


:bgrin:
Title: Re: Uncle Remus Tales
Post by: zedd151 on June 06, 2018, 08:34:14 AM
No, okay I got it. I read further on and in the source == exe looking for movie.gif.

That's pretty good there, Mikl__.

edit == converted the screen capture to gif for size.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 03, 2018, 11:07:02 AM
Windows Creator
A training program for experimenting with numerous parameters of the functions used - so you do not have to edit and compile the source code of the "training" project each time, and you could select the necessary options right in the dialog box and immediately see the result.
Because the forum does not allow you to attach more than four files, so I had to break the message into three parts
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 03, 2018, 11:09:04 AM
continuation
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 03, 2018, 11:12:12 AM
ending
asm-/exe- and resource-files and bat-file for building
Title: Re: Uncle Remus Tales
Post by: jj2007 on August 03, 2018, 04:14:21 PM
Fascinating stuff, Mikl! In particular, I wonder how you build that 48-bit code ;)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 04, 2018, 01:40:10 AM
Ciao, Jochen!
Why did you write about 48-bit code? (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
Title: Re: Uncle Remus Tales
Post by: jj2007 on August 04, 2018, 02:10:49 AM
Have a closer look at the path:
(http://masm32.com/board/index.php?action=dlattach;topic=6275.0;attach=8300;image)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 04, 2018, 02:16:58 AM
In the beginning there was a directory "masm64", then I created a new directory "masm63", then, well, you can guess yourself... (https://wasm.in/styles/smiles_s/mosking.gif)
Title: Re: Uncle Remus Tales
Post by: zedd151 on August 04, 2018, 02:58:08 AM
Quote from: Mikl__ on August 04, 2018, 02:16:58 AM
then I created a new directory "masm63"

(https://wasm.in/styles/smiles_s/mosking.gif)

Sounded like masm64 was a little under par.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 04, 2018, 11:24:12 AM
Ciao, Jochen!
Hi, All!
Tiny help for the windows creator
You must have a directory of masm48 and subdirectories of bin, lib, include. There are ml64.exe, link.exe etc. in masm48\bin and lib- and inc-files in lib- and include-subdirectories. You can change the folder name "masm48" to the one you use. Look carefully at the contents of the file asm3.bat and configure it for yourself. The names of the folders and the structure of your package with the assembler compiler ONLY inside the file asm3.bat.
If you see errors in the description in English, please write me about them and I will make corrections.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 05, 2018, 07:13:20 PM
Rotating Text Window
I once laid out the program with rotating text, now I had to update it, because with a sharp change in the size of the window, the rotating inscription lost the center of the window and its movements became unpredictable. Now I have corrected this defect
; GUI #
include win64a.inc
.code
WinMain proc
local msg:MSG

    xor ebx,ebx
    mov esi,IMAGE_BASE
    mov edi,offset ClassName
mov ecx,offset FileName
invoke LoadCursorFromFile
mov r12,rax
        mov ecx,0FF0000h
invoke CreateSolidBrush
    push r12 ;hIconSm
    push rdi ;lpszClassName
    push rbx ;lpszMenuName
    push rax ;hbrBackground
    push 10003h ;hCursor
    push r12 ;hIcon
    push rsi ;hInstance
    push rbx ;cbClsExtra & cbWndExtra
    pushaddr WndProc    ;lpfnWndProc
    push sizeof WNDCLASSEX;cbSize & style
    invoke RegisterClassEx,esp    ;addr WNDCLASSEX
    push rbx
    push rsi ;rsi=400000h
    shr esi,7 ;Special CreateWindow position value CW_USEDEFAULT=8000h
    push rbx
    push rbx
    push rsi
    push rsi
    push rsi
    push rsi
    sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
;create timer #0 in 50mSec
    invoke SetTimer,eax,0,50,0
; +---------------------------+
; | entering the message loop |
; +---------------------------+
lea edi,msg
@@: invoke GetMessage,edi,0,0,0
invoke DispatchMessage,edi
jmp @b
WinMain endp
WndProc proc hwnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local ps:PAINTSTRUCT
local newFont:qword
local oldFont:qword
local x1:dword
local y1:dword
local hDC:qword
local lpPoint:POINT

    mov hwnd,rcx

    cmp edx,WM_DESTROY
    je wmDESTROY
    cmp edx,WM_PAINT
    je wmPAINT
        cmp edx,WM_SIZE
    je wmSIZE
    cmp edx,WM_TIMER
    je wmTIMER
    leave
    jmp NtdllDefWindowProc_
wmDESTROY:invoke KillTimer,,0;destroy timer #0
invoke RtlExitUserProcess,0
wmSIZE: mov edx,offset expRect
invoke GetClientRect    ;get the size of the client area.
;Dimensions return to a variable expRect
mov eax,expRect.bottom
shr eax,1   
mov y,eax ;y-coordinate of the middle of the screen
mov eax,expRect.right
shr eax,1   
mov x,eax ;x-coordinate of the middle of the screen
jmp wmBYE
wmTIMER:invoke InvalidateRect,,0,TRUE;redraw the text with the current angle value
finit
jmp wmBYE
wmPAINT:lea edx,ps
invoke BeginPaint
mov hDC,rax
invoke SetTextColor,hDC,32C8C8h;RGB=50,200,200 golden letters
invoke SetBkColor,hDC,0FF0000h;RGB=0,0,255 on a blue background
;create a font with the rotation angle specified in lfEscapement and lfOrientation
pushaddr expFont
push DEFAULT_PITCH or FF_SCRIPT
push rbx        ;DEFAULT_QUALITY=0
push rbx        ;CLIP_DEFAULT_PRECIS=0
push rbx        ;OUT_DEFAULT_PRECIS=0
push OEM_CHARSET
push rbx
push rbx
push rbx
push 400
sub esp,20h
invoke CreateFont,26,12,angle,r8
mov newFont,rax
invoke SelectObject,hDC,rax
mov oldFont,rax
;---------text output
mov qword ptr [rsp+20h],sizeof expTxt;length of string
mov r9d,offset expTxt           ;line address
;---------I calculate the position of the beginning of the text
fld angle2;angle of text rotation in radians
fld st(0)
fsincos ;in st(0) the sine of the angle, in st(1) cosine
mov y1,227    ;half of hypotenuse
fimul y1    ;hypotenuse * sin = x
fistp x1
mov edx,x
add edx,x1
fimul y1    ;hypotenuse * cos = y
fistp y1    ;-y
fadd delta      ;increased the angle by 1.6 degrees
fst angle2
fmul delta2 ;translate radians to degrees
fsub delta3  ;The angle of the text is lagging behind the rotation angle by 180 degrees
fld st(0)
fmul delta4
fsubp st(1),st(0)
fistp angle     ;divide the angle by 360 degrees and remember the remainder
mov r8d,y
sub r8d,y1
invoke TextOut,hDC
invoke DeleteObject,newFont ;delete the new font
invoke SelectObject,hDC,oldFont;return the old font to the system
invoke EndPaint,hwnd,&ps
wmBYE:leave
    retn
WndProc endp
;---------------------------------------
ClassName db "Uncle Remus tales:#5 Painting with Rotation Text",0
expTxt  db "Win64 assembly with MASM is great and easy!",0
expFont db "script",0
angle   dq 0
angle2  dq 3.14159265358979323846264338328
delta   dq 0.02792526803190927323077905229;pi*1,6/180
delta2 dq 572.957795130823208767981548141;1800/pi
delta3 dq 1800.0
delta4 dq 0.00027777777777777777777777778;1/3600
hIcon dq ?
FileName db "br_Rabbit3.cur",0
expRect  RECT <>
x dd ?
y dd ?
end
Title: Re: Uncle Remus Tales
Post by: zedd151 on August 05, 2018, 07:30:53 PM
Could be a problem on my end, (no video driver available for Win 7 for this new hardware) but the text stays centered, but there is a lot of flicker in the text (disappearing and reappearing - correct  location, though)  Windows 7 , AMD A6-9220e, RADEON graphics.

I'm going to fire up windws 10 (has all drivers installed) and take another look at it...   8)
Title: Re: Uncle Remus Tales
Post by: zedd151 on August 05, 2018, 07:41:28 PM
I fubarred the captioning.

The TOP image is from Windows 10 Home 64 bit - all drivers installed. No flicker, but the text is odd.

The bottom image is from Windows 7 Pro 64 bit - No proper video drivers available, old OS New Hardware.
So the flickering is from my end, your program works well in Windows 10 - other than the odd font (strike
through and underlined) - might be an odd font variation from the OS???
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 05, 2018, 08:50:43 PM
Hi, zedd151!
Thanks for the noticed error. I'll try to fix the blinking text
Title: Re: Uncle Remus Tales
Post by: zedd151 on August 05, 2018, 09:41:59 PM
Quote from: Mikl__ on August 05, 2018, 08:50:43 PM
Hi, zedd151!
Thanks for the noticed error. I'll try to fix the blinking text

Don't worry about that just yet. Let a few others test your program.
My Windows 7 setup does not have the proper video drivers installed, only the default stock
Microsoft video drivers.

The program shows no signs of flickering in WIndows 10, in which I have the factory installed
RADEON video drivers installed. just the font looks weird..
Title: Re: Uncle Remus Tales
Post by: hutch-- on August 06, 2018, 03:55:13 AM
Mikl__, could I impose on you not to use too many bitmaps that are stored on this server as it takes up a lot more space than code and I cannot let the storage space fill up.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 06, 2018, 09:16:03 AM
Hi, hutch--!
Well, I will not abuse and upload bitmaps.
Title: Re: Uncle Remus Tales
Post by: hutch-- on August 06, 2018, 01:17:37 PM
 :biggrin:

Спасибо.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 08, 2018, 11:46:07 PM
Work with Fonts
asm-file; GUI #
include win64a.inc
ID_RESET equ 0
ID_FONT equ 1
ID_HELP equ 2
ID_EXIT equ 3
IDM_MENU equ 37
IDC_ICON1 equ 500
IDR_MAINACCEL equ 105
.code
WinMain proc
local msg:MSG
   
xor ebx,ebx
mov ecx,offset FileName
invoke LoadCursorFromFile
mov esi,IMAGE_BASE
mov edi,offset ClassName
push rax    ;hIconSm
push rdi    ;lpszClassName
push IDM_MENU    ;lpszMenuName
push COLOR_WINDOW;hbrBackground
push 10003h ;hCursor
push rax    ;hIcon 
push rsi    ;hInstance
push rbx    ;cbClsExtra & cbWndExtra
pushaddr WndProc ;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp;addr WNDCLASSEX
push rbx
push rsi    ;rsi=400000h
shl esi,9   ;rsi=CW_USEDEFAULT
push rbx
push rbx
push rsi
push rsi
push rsi
push rsi
sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
mov hwnd,rax
invoke LoadAccelerators,IMAGE_BASE,IDR_MAINACCEL
mov ACC,rax
    lea edi,msg
@@:     invoke GetMessage,edi,0,0,0
        invoke TranslateAccelerator,hwnd,ACC,edi
or eax,eax
jne @b
invoke TranslateMessage,edi
invoke DispatchMessage,edi
jmp @b
WinMain endp
;----------------------------------------
WndProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
local ps:PAINTSTRUCT
local hdc:qword
local size0:POINT
local string[255]:byte
local cf:CHOOSEFONT
local lf:LOGFONT

        mov hWnd,rcx
   
        cmp edx,WM_DESTROY
        je wmDESTROY
        cmp edx,WM_CREATE
        je wmCREATE
        cmp edx,WM_PAINT
        je wmPAINT
        cmp edx,WM_COMMAND
        je wmCOMMAND
        leave
        jmp NtdllDefWindowProc_
wmDESTROY:invoke DeleteDC,memDC
invoke DeleteObject,hNewFont1
invoke DeleteObject,hNewFont2
invoke RtlExitUserProcess,0
wmCOMMAND:and r8d,11111y;wParam
cmp r8d,ID_EXIT
ja wmBYE
jmp handler[r8*8]
FONT:
;----------------------------------
push rdi
xor eax,eax
mov ecx,(sizeof CHOOSEFONT)/8
lea edi,cf
rep stosq
pop rdi; ZeroMemory
mov     cf.lStructSize,sizeof CHOOSEFONT
mov rax,hwnd
mov cf.hwndOwner,rax
lea eax,lf
mov cf.lpLogFont,rax
mov cf.Flags,CF_SCREENFONTS or CF_EFFECTS;
lea ecx,cf
invoke ChooseFont
or eax,eax
jz wmBYE
lea ecx,lf
invoke CreateFontIndirect
invoke SelectObject,memDC,eax
invoke SetTextColor,memDC,cf.rgbColors
invoke SetBkMode,memDC,TRANSPARENT
mov edx,offset tm
invoke GetTextMetrics,memDC
lea ecx,string
mov edx,offset fmt1
lea r8d,lf.lfFaceName
mov r9d,tm.tmHeight
invoke wsprintf
;выводим строку
lea r9d,string
invoke TextOut,memDC,X,Y,,rax
mov eax,tm.tmHeight
add eax,tm.tmExternalLeading
add Y,rax
mov qword ptr [rsp+20h],sizeof string1
lea r9d,string1
invoke TextOut,memDC,X,Y
mov r8d,sizeof string1
lea edx,string1
lea r9d,size0
invoke GetTextExtentPoint32,memDC
mov eax,size0.x
mov X,rax
lea ecx,string
mov edx,offset fmt2
mov r8d,size0.x
invoke wsprintf
lea r9d,string
invoke TextOut,memDC,X,Y,,rax
mov eax,tm.tmHeight
add eax,tm.tmExternalLeading
add Y,rax
and X,0
lea ecx,string
mov edx,offset fmt3
invoke wsprintf,,,maxX,maxY
lea r9d,string
invoke TextOut,memDC,X,Y,,rax
mov eax,tm.tmHeight
add eax,tm.tmExternalLeading
add Y,rax
invoke InvalidateRect,hWnd,0,1
jmp wmBYE
RESET:  and X,0
and Y,0
invoke PatBlt,memDC,0,0,maxX,maxY,PATCOPY
        invoke InvalidateRect,hWnd,0,1
jmp wmBYE
HELP: mov ecx,offset mb
invoke MessageBoxIndirect
jmp wmBYE
wmCREATE:invoke GetSystemMetrics,SM_CXSCREEN
mov maxX,rax
        invoke GetSystemMetrics,SM_CYSCREEN
mov maxY,rax
invoke GetDC,hWnd
mov hdc,rax
invoke CreateCompatibleDC,eax
mov memDC,rax
invoke CreateCompatibleBitmap,hdc,maxX,maxY
        invoke SelectObject,memDC,eax
invoke GetStockObject,WHITE_BRUSH
        invoke SelectObject,memDC,eax
invoke PatBlt,memDC,0,0,maxX,maxY,PATCOPY
invoke SetBkMode,memDC,TRANSPARENT
        invoke ReleaseDC,hWnd,hdc
jmp wmBYE
wmPAINT:lea edx,ps
        invoke BeginPaint       
mov hdc,rax
        invoke BitBlt,eax,0,0,maxX,maxY,memDC,0,0,SRCCOPY       
        lea edx,ps
        invoke EndPaint,hWnd
wmBYE:  leave
        retn
handler dq RESET,FONT,HELP,wmDESTROY
WndProc endp
;-----------------------------------------
ClassName db "Uncle Remus tales:#5e Work with Font",0
expTxt db "Win64 assembly with MASM is great and easy",0
FileName db "br_Rabbit3.cur",0
hwnd dq ?
fmt1 db 'Font height "%s" is %d pixels',0
string1 db "This is the next line.",0
fmt2 db "Length of the previous line is %d units",0
fmt3 db "Screen size is %d by %d",0
ACC dq ?
tm TEXTMETRICA <>
X dq 0
Y dq 0
maxX dq ?
maxY dq ?
memDC dq ?
hOldFont dq ?
hNewFont1 dq ?
hNewFont2 dq ?
MBText db "F1: Help",10,"F2: Choose font",10,"F3: Clear screen",10,"Ctrl+X: Exit",0
mb label   MSGBOXPARAMS
  dd sizeof MSGBOXPARAMS,?;cbSize      
  dq 0  ;hwndOwner
  dq IMAGE_BASE  ;hInstance      
  dq MBText  ;lpszText    
  dq ClassName  ;lpszCaption
  dd MB_OK or MB_USERICON or MB_TOPMOST,?;dwStyle
  dq IDC_ICON1  ;lpszIcon
  dd 0,?;dwContextHelpId
  dq 0  ;lpfnMsgBoxCallback
  dd 0,?;dwLanguageId
end
rc-file#include "resource.h"
#define ID_RESET 0
#define ID_FONT 1
#define ID_HELP 2
#define ID_EXIT 3
#define IDM_MENU 37
#define IDC_ICON1 500
#define IDR_MAINACCEL 105
IDC_ICON1 ICON DISCARDABLE "br_Bear4.ico"
IDM_MENU MENU
{
    POPUP "&Font"
    {
    MENUITEM "Choose &font\tF2",ID_FONT
    MENUITEM "&Clear Screeen\tF3",ID_RESET
    MENUITEM "&Help\tF1",ID_HELP
MENUITEM SEPARATOR
        MENUITEM "E&xit\tCtrl+X",ID_EXIT
}
    MENUITEM "E&xit",ID_EXIT
}
IDR_MAINACCEL ACCELERATORS DISCARDABLE

VK_F1, ID_HELP,VIRTKEY
VK_F2, ID_FONT,VIRTKEY
VK_F3, ID_RESET,VIRTKEY
"^X",  ID_EXIT
}
P.S. Hi, hutch--! Size of zip-file and png-files are 83 kBytes (https://wasm.in/styles/smiles_s/yes3.gif)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 29, 2019, 01:28:21 PM
The program demonstrates the text output on the screen in 10 ways
I have already shown a similar program (http://masm32.com/board/index.php?topic=4190.msg47313#msg47313). But it had to be redone, as with an increase in the volume of the text, problems begin with its redrawing and blinking.
In the attachment the source code of the program, the icon and the exe-file
Title: Re: Uncle Remus Tales
Post by: felipe on January 29, 2019, 03:09:08 PM
mikl__ looks like an interesting program, but unfortunately seems like it dosen't work well (at least in my system... :idea:). when i run the program no window is displayed and the program remains running (i can see it with the taskmanager). so after that i have to kill the process... :idea:
Title: Re: Uncle Remus Tales
Post by: TimoVJL on January 29, 2019, 06:58:03 PM
What codepage the source text use ?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 29, 2019, 09:41:57 PM
Hei Timo,
käytin Windows-1251-kooditaulukkoa (used the code page Windows-1251)
This is the Russian translation of "Uncle Remus's Tales". But this is not critical. This is a demonstration of displaying a few dozen lines..
Title: Re: Uncle Remus Tales
Post by: TimoVJL on January 29, 2019, 11:00:53 PM
Спасибо!
With notepad2 it is possible to convert and see the russian language text and comments.
Notepad2 have a Encoding Recode option.
Title: Re: Uncle Remus Tales
Post by: jj2007 on January 30, 2019, 08:12:33 AM
Looks exotic :P
mov r8d,offset expTxt0
mov edx,offset aStatic
sub esp,20h
invoke CreateWindowEx,0,,,SS_LEFT or WS_CHILD or WS_VISIBLE
mov hStaticText1,rax
;создания элемента STATIC для вывода текста функцией SendMessage
Title: Re: Uncle Remus Tales
Post by: aw27 on January 31, 2019, 12:15:28 AM
It does not launch as well here and I can't find a version of the win64a.inc that does not produce errors when building. I am sure Mikl__ might have posted a link to a working version somewhere, or may be I am just confused (Alzheimer, may be?).
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 31, 2019, 12:36:26 AM
Hmm... Strange
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 31, 2019, 12:39:11 AM
a continuation
Title: Re: Uncle Remus Tales
Post by: jj2007 on January 31, 2019, 01:13:49 AM
Hi Mikl,

I can't build it because I don't yet have a consistent Win64 installation, but nonetheless I have a question regarding these lines:
mov r8d,offset expTxt0
mov edx,offset aStatic
sub esp,20h


Now that is obviously 64-bit code. Does the fact that you use edx and esp mean that you assume the addresses are 32-bit? I remember vaguely that years ago a group of programmers tried to promote a system with 64-bit instructions but 32-bit addresses.
Title: Re: Uncle Remus Tales
Post by: aw27 on January 31, 2019, 01:50:23 AM
It builds with LARGEADDRESSAWARE:NO (you hate 64-bit!) in link and -Cp in ml64.
However it does not run.
You are using a set of unusual build parameters, so please let us know them. From a previous post I have seen things like /ALIGN:16 /SECTION:.text,W /BASE:0x400000. If I use these it does indeed launch but shows crap.
In short, how do you build this?  :biggrin:
Now all makes sense, including putting the data in the code section....
Title: Re: Uncle Remus Tales
Post by: aw27 on January 31, 2019, 02:25:05 AM
All right, it shows crap because I am not using the Windows-1251 character encoding.

(https://www.dropbox.com/s/xgv1te794oit1c9/remuscrap.jpg?dl=1)

I notice that the first tab with caption Static disappeared in my Windows 10.
Title: Re: Uncle Remus Tales
Post by: aw27 on February 03, 2019, 09:17:58 PM
BTW, even without Unicode you can display Russian strings to western people.
All you need to do is CreateFont with RUSSIAN_CHARSET (most fonts will do, no need for a Russian font).
Then when is time to render the string you SelectObject with that font before DrawText.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 03, 2019, 11:19:34 PM
Hi, AW!
I am very sorry that any text except the English text is rubbish ("crap") for you. Of course, in order to display the text in 10 ways, it was necessary to take 10 chapters from "Uncle Remus' Stories" in the Nigger Dixie dialect.
QuoteThis is the Russian translation of "Uncle Remus's Tales". But this is not critical. This is a demonstration of displaying a few dozen lines..
Title: Re: Uncle Remus Tales
Post by: jj2007 on February 04, 2019, 12:51:02 AM
Hi, Mikl!

It feels very strange to defend José, but in this particular case when he writes "crap" he means that the control does not display the cyrillian text correctly. Indeed, it shows something else - but that is a minor problem, it's just a codepage issue  8)
Title: Re: Uncle Remus Tales
Post by: aw27 on February 04, 2019, 02:04:52 AM
Hi, Mikl!
I can imagine, but I always thought Uncle Remus was Russian.   ::)

Oh JJ,
Thankies. it is indeed a "minor" codepage issue, although very few people know how to solve it. I searched the internet and did not found a single instance of the correct solution. Lots of incorrect suggestions.
Title: Re: Uncle Remus Tales
Post by: jj2007 on February 04, 2019, 04:20:30 AM
I can imagine :P

CreateFont with RUSSIAN_CHARSET is indeed an interesting idea, thanks; although in general it is easier to simply use the UTF-16 version of the edit control. You can even mix Russian, Chinese and Arabic then.
Title: Re: Uncle Remus Tales
Post by: aw27 on February 04, 2019, 07:21:40 PM
Quote from: jj2007 on February 04, 2019, 04:20:30 AM
CreateFont with RUSSIAN_CHARSET is indeed an interesting idea, thanks; although in general it is easier to simply use the UTF-16 version of the edit control. You can even mix Russian, Chinese and Arabic then.
UTF-16 is better but in some countries is not well accepted. This may not happen in Russia but in Japan they still prefer Shift-JIS. In other words suppose you want to convince Japanese people to use Rich Masm, better you make the menus and everything else in Shift-JIS. This happened to me, my agent said we would sell lots of software in Japan with a Japanese localization but could only be Shift-JIS.  At the time I had a Windows XP Japanese release only for testing. Something crazy to navigate it.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 18, 2019, 08:19:48 PM
There is GDI+ in the console program
asm-file;; CONSOLE #
include win64a.inc
includelib winmm.lib
include winmm.inc
include gdiplus.inc
includelib gdiplus.lib
MAXSCREENX = 600/8
MAXSCREENY = 315/12
.code
WinMain proc
local result:qword
local hIn:qword
local IDtimer:qword
local ConsoleWindow:SMALL_RECT
local cci:CONSOLE_CURSOR_INFO
local MOUSE_KEY:INPUT_RECORD

        invoke  FreeConsole ;release the existing console
        invoke  AllocConsole    ;create the console
        invoke  GetStdHandle,STD_INPUT_HANDLE
        mov hIn,rax                        ; receive handle for a input
        invoke  GetStdHandle,STD_OUTPUT_HANDLE
        mov hOut,rax                       ; receive handle for a output
    invoke  GetLargestConsoleWindowSize,eax
;   eax return in 31-16 bits: dwCoord.y
;                 15-00 bits: dwCoord.x
        lea r8d,ConsoleWindow       ; lpConsoleWindow
    and dword ptr [r8],0
;ConsoleWindow.Left = 0   ConsoleWindow.Top = 0
    sub ax, MAXSCREENX
    sbb edx, edx
    and ax, dx
    add ax, MAXSCREENX-1
    mov [r8+SMALL_RECT.Right],ax
    shr eax, 16
    sub eax, MAXSCREENY
    sbb edx, edx
    and eax, edx
    add eax, MAXSCREENY-1
    mov [r8+SMALL_RECT.Bottom],ax
    invoke  SetConsoleWindowInfo,hOut,TRUE
    invoke  SetConsoleScreenBufferSize,hOut,MAXSCREENY*10000h+MAXSCREENX  ; establish the new size of console window
; initialise GDIPlus
mov ecx,offset graphics
mov edx,offset gdii
invoke GdiplusStartup,,,0

        invoke  SetConsoleTitle,&NameConsole     ;definition of a title bar
        invoke  timeSetEvent,200,0,&TIME,0,TIME_PERIODIC
    mov IDTimer,rax
        invoke  SetConsoleCursorPosition,hOut,0;Y=0 X=0
    invoke  WriteConsole,hOut,&STR1,sizeof STR1,&result,0
invoke  GetConsoleWindow
    mov hWnd,rax
    invoke  GetDC,rax       ;получить DC
    mov hDC,rax
        lea edx,gdiHgraphics
invoke GdipCreateFromHDC,eax; Get graphics "object" from DC handle
        mov ecx,offset FileNameU
        invoke GdipLoadImageFromFile,,ADDR gdiHbitmap   ; Open JPEG file
@@:     invoke  ReadConsoleInput,hIn,&MOUSE_KEY,1,&result
        lea edx,MOUSE_KEY
    cmp [rdx+INPUT_RECORD.EventType],MOUSE_EVENT
    je @b
    cmp     [rdx+INPUT_RECORD.EventType],KEY_EVENT
    jne @b
    cmp [rdx+INPUT_RECORD.KeyEvent.wVirtualKeyCode],VK_ESCAPE
    jne @b
invoke  ReleaseDC,hWnd,hDC       ;free hDC
    invoke  timeKillEvent,IDTimer
    invoke  FreeConsole ;close console
        invoke GdiplusShutdown,graphics        ; cleanup on exit
    invoke RtlExitUserProcess,NULL
WinMain endp
TIME proc
local   dummy:qword

invoke GdipDrawImageI,gdiHgraphics, gdiHbitmap,0,15
    leave
    retn
TIME endp
;----------------------------------------
hDC dq ?
hWnd dq ?
gdiHbitmap dq ?
gdiHgraphics dq ?
gdii GdiplusStartupInput <1,0,0,0>
graphics dq ?
STR1 db 'For exit from program press ESC or CTRL+C or CTRL+Break'
NameConsole db 'JPG Image in Console',0
hOut dq ?
FileNameU: du <background.jpg>
IDTimer dq ?
end
There are asm-/jpg-/exe-files in attachment
Title: Re: Uncle Remus Tales
Post by: jj2007 on August 19, 2019, 04:11:49 AM
Cute idea, Mikl!
Title: Re: Uncle Remus Tales
Post by: hutch-- on August 19, 2019, 02:40:23 PM
 :biggrin:

Nice image of Ethiopia, I wonder where that came from ?  :tongue:
Title: Re: Uncle Remus Tales
Post by: Mikl__ on August 19, 2019, 03:48:35 PM
Hi, jj and hutch--!
That is jpg-file from the new_masm32->examples64->jpg_image lesson. But is it really so important where did I get the jpg-file? I hope that I have not infringed on any copyrights? If it is so, then I am apologizing...
(http://cyberstatic.net/images/smilies/smile3.gif)
Title: Re: Uncle Remus Tales
Post by: hutch-- on August 20, 2019, 12:36:08 AM
 :biggrin:

Nothing to apologise for, I will give you a bigger version of it if you like.
Title: Re: Uncle Remus Tales
Post by: learn64bit on January 17, 2020, 02:00:20 PM
Someone Help Me!
Microsoft Windows 7 Ultimate 64-bit us with Service Pack 1
Microsoft Windows SDK v7.0
  CMD Shell
   #Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
   #.
   #Targeting Windows 7 x64 DEBUG
   #
   #
   #C:\Program Files\Microsoft SDKs\Windows\v7.0>Setenv /Release
    #Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
    #.
    #Targeting Windows 7 x64 RELEASE
    #
    #
    #C:\Program Files\Microsoft SDKs\Windows\v7.0>cd \learnASM
    #
    #C:\learnASM>ml64 08.asm /link /subsystem:console /defaultlib:kernel32.lib /defaul
    #tlib:user32.lib /entry:WinMain
    #Microsoft (R) Macro Assembler (x64) Version 9.00.30729.01
    #Copyright (C) Microsoft Corporation.  All rights reserved.
    #
    # Assembling: 08.asm
    #08.asm(2) : fatal error A1000:cannot open file : win64a.inc
    #
    #C:\learnASM>


after downloaded Mikl__'s include.zip
C:\learnASM>ml64 /Cp /c 08.asm
Microsoft (R) Macro Assembler (x64) Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Assembling: 08.asm
08.asm(14) : error A2006:undefined symbol : SMALL_RECT
08.asm(14) : error A2195:parameter or local cannot have void type
08.asm(15) : error A2006:undefined symbol : CONSOLE_CURSOR_INFO
08.asm(15) : error A2195:parameter or local cannot have void type
08.asm(16) : error A2006:undefined symbol : INPUT_RECORD
08.asm(16) : error A2195:parameter or local cannot have void type
08.asm(34) : error A2006:undefined symbol : SMALL_RECT
08.asm(40) : error A2006:undefined symbol : SMALL_RECT
08.asm(63) : error A2006:undefined symbol : INPUT_RECORD
08.asm(65) : error A2006:undefined symbol : INPUT_RECORD
08.asm(67) : error A2006:undefined symbol : INPUT_RECORD

C:\learnASM>


after downloaded Mikl__'s Win x64 Tutorial #38 Microsoft Windows 7 Ultimate 64-bit us with Service Pack 1
Microsoft Windows SDK v7.0
  CMD Shell
   #Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
   #.
   #Targeting Windows 7 x64 DEBUG
   #
   #
   #C:\Program Files\Microsoft SDKs\Windows\v7.0>Setenv /Release
    #Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
    #.
    #Targeting Windows 7 x64 RELEASE
    #
    #
    #C:\Program Files\Microsoft SDKs\Windows\v7.0>cd \learnASM
    #
    #C:\learnASM>ml64 /Cp /c 08.asm
    #Microsoft (R) Macro Assembler (x64) Version 9.00.30729.01
    #Copyright (C) Microsoft Corporation.  All rights reserved.
    #
    # Assembling: 08.asm
    #
    #C:\learnASM>link /subsystem:console /largeaddressaware:no /align:16 /entry:WinMai
    #n 08.obj
    #Microsoft (R) Incremental Linker Version 9.00.30729.01
    #Copyright (C) Microsoft Corporation.  All rights reserved.
    #
    #LINK : warning LNK4108: /ALIGN specified without /DRIVER; image may not run
    #
    #C:\learnASM>
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 02:48:39 AM
Hi, learn64bit!
universal bat-file
cls
set masm64_path=\masm44\
set filename=%~n1
if exist errors.txt del errors.txt

call :read_settings %filename%
@echo %kind_of_file%
goto %kind_of_file%
:CONSOLE
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj %filename%.res >> errors.txt
if exist %1.res del %1.res
) else (
%masm64_path%bin\link /SUBSYSTEM:CONSOLE /LIBPATH:"%masm64_path%Lib" ^
/entry:WinMain %filename%.obj /LARGEADDRESSAWARE:NO ^
/ALIGN:16 /SECTION:.text,W /BASE:0x400000 /STUB:%masm64_path%\bin\stubby.exe >> errors.txt
)
if errorlevel 1 exit
del %filename%.obj

goto exit1
:GUI
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj %filename%.res >> errors.txt
if exist %1.res del %1.res
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj >> errors.txt
)
if errorlevel 1 exit
goto exit1
:DLL
if exist %filename%.dll del %filename%.dll
%masm64_path%bin\ml64 /c /Cp /I %masm64_path%include %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r  %filename%.rc >> errors.txt
if errorlevel 1 exit
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj %filename%.res /DEF:%filename%.def >> errors.txt
if exist %1.res del %1.res
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj /DEF:%filename%.def >> errors.txt
)
if errorlevel 1 exit
del %filename%.exp
:exit1
del %filename%.obj
del errors.txt
:: %filename%.exe
exit
:read_settings
for /f "eol=# tokens=2-3" %%A in (%filename%.asm) do (
set kind_of_file=%%A
if %%B == # exit /b )
exit /b
lib-files
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 02:49:48 AM
include-files
Title: Re: Uncle Remus Tales
Post by: learn64bit on January 18, 2020, 06:13:44 PM
I don't have the 'stubby.exe' file....
Sir, can you upload your 'masm64_path' folder.
Your masm64 examples are great. Which makes learning about and exploring masm64 programming very easy.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 10:36:04 PM
part 1-st
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 10:38:26 PM
part 3-rd
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 10:41:33 PM
part 2-nd
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 10:44:46 PM
part 4-th
rename files to bin.zip.001, bin.zip.002, bin.zip.003, bin.zip.004  place in one directory and unzip
https://wasm.in/threads/skazki-djadjushki-rimusa.31832/
Title: Re: Uncle Remus Tales
Post by: jj2007 on January 18, 2020, 11:00:05 PM
Hi Mikl,
Google translated your Russian thread for me, with some glitches but still with remarkable quality. Compliments for your great work :thumbsup:
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 11:04:44 PM
grazie mille signore jj2007 (https://wasm.in/styles/smiles_s/good3.gif)
Title: Re: Uncle Remus Tales
Post by: aw27 on January 18, 2020, 11:09:45 PM
Mr. Skazki Djadjushki Rimusa, famous Russian writer.

https://ruslania.com/en/books/284493-the-tales-of-uncle-remus-skazki-djadjushki-rimusa/
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 18, 2020, 11:25:54 PM
Hi, AW!
"Famous Russian writer" is Joel Chandler Harris (December 9, 1848 - July 3, 1908). He was an American journalist, fiction writer, and folklorist best known for his collection of Uncle Remus stories.

Walt Disney's "Song of the South" (1946), a combination of live action and animation with James Baskett as Remus
(http://images6.fanpop.com/image/photos/40200000/Uncle-Remus-and-Brer-Rabbit-song-of-the-south-40275377-448-331.jpg)
Splash Mountain is a long flume at Disneyland, Tokyo Disneyland, and the Magic Kingdom at the Walt Disney World Resort, based on the characters, stories, and songs from the film "Song of the South". Each installation begins with a peaceful outdoor float-through that leads to indoor dark ride segments, with a climactic steep drop into a "briar patch" followed by an indoor finale. The drop is 50 feet.

The plot behind Splash Mountain is a composite of several Uncle Remus stories. Each ride presents scenes taken from the animated segments of "Song of the South", telling the story of Br'er Rabbit.
(https://cdn41.zvooq.com/pic?type=release&id=4723785&size=500x500&ext=jpg)
Title: Re: Uncle Remus Tales
Post by: learn64bit on January 18, 2020, 11:36:01 PM
Great! I use 7-Zip to get bin.zip.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 19, 2020, 12:08:09 AM
Hi, learn64bit!
Title: Re: Uncle Remus Tales
Post by: aw27 on January 19, 2020, 05:53:15 AM
Thank you for the explanation! I had never heard about those stories and I am not aware of the American culture in general. I always though Americans have no culture at all, but this is a stereotype.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 19, 2020, 10:07:50 AM
Hi, AW!
will add  to your messages tags [sarcasm] and [/sarcasm] please.
QuoteMr. Skazki Djadjushki Rimusa, famous Russian writer.
When translating it is difficult to determine whether the interlocutor is joking or not. Sorry for my bad english. (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
Title: Re: Uncle Remus Tales
Post by: aw27 on January 19, 2020, 07:35:41 PM
No sarcasm at all, "Uncle Remus" sounded to me like a plausible Russian name.
Anyway, it was a great work you did. I had been an occasional technical translator in the 80's and 90's and it is the hell of a job. For my own use I only work in English originals, never translations.
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 19, 2020, 07:51:08 PM
Remus isn't Russian name
(https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/She-wolf_suckles_Romulus_and_Remus.jpg/350px-She-wolf_suckles_Romulus_and_Remus.jpg)
Br'er Romulus and uncle Remus and mommy "La Lupa Capitolina" (the Capitol Female Wolf) (https://wasm.in/styles/smiles_s/mosking.gif)
Title: Re: Uncle Remus Tales
Post by: aw27 on January 20, 2020, 01:34:42 AM
Yeah, makes sense. Italian emigrants to the US, named their slave Remus and their dog Romulus.  :skrewy:
Title: Re: Uncle Remus Tales
Post by: Mikl__ on October 27, 2021, 09:44:55 AM
The sad end of Uncle Remus Tales.
Disney parks change the Splash Mountain attraction due to racism

The campaign to combat racism that has swept the United States after police killing african american George Floyd has no boundaries. Following the demolition of monuments to the leaders of the Confederation, Christopher Columbus and the Founding Fathers of the United States, it came to reforming the sphere of children's entertainment.

Vicious "Songs of the South"

"The Song of the South" is a 1946 American live-actors/animated musical drama film produced by Walt Disney and released by RKO Radio Pictures. It is based on the collection of Uncle Remus stories as adapted by Joel Chandler Harris, and stars James Baskett as Uncle Remus. The film takes place in the southern United States during the Reconstruction era, a period of American history after the end of the American Civil War and the abolition of slavery. The story follows seven-year-old Johnny (Bobby Driscoll) who is visiting his grandmother's plantation for an extended stay. Johnny befriends Uncle Remus, one of the workers on the plantation, and takes joy in hearing his tales about the adventures of Br'er Rabbit, Br'er Fox, and Br'er Bear. Johnny learns from the stories how to cope with the challenges he is experiencing while living on the plantation.

Walt Disney had wanted to produce a film based on the Uncle Remus stories for some time. It was not until 1939 that he began negotiating with the Harris family for the film rights, and in 1944, filming for "The Song of the South" began. The studio constructed a plantation set for the outdoor scenes in Phoenix, Arizona, while other scenes were filmed in Hollywood. The film is predominantly live-actors, but includes three animated segments, which were later released as stand-alone television features. Some scenes also feature a combination of live-actors with animation. "The Song of the South" premiered in Atlanta in November 1946 and the remainder of its initial theater run was a financial success.  Walt Disney was impressed with Baskett's talent and hired him on the spot for the lead role of Uncle Remus. Baskett was also given the voice role of Brer Fox, one of the film's animated antagonists, and also filled in as the main animated protagonist, Brer Rabbit, in one sequence. This was one of the first Hollywood portrayals of a black actor as a non-comic character in a leading role in a film meant for general audiences.

Baskett was prohibited from attending the film's premiere in Atlanta, Georgia, because Atlanta was racially segregated by law.

Although Baskett was occasionally criticized for accepting such a "demeaning" role (most of his acting credits were that of African-American stereotypes), his acting was almost universally praised, and columnist Hedda Hopper, along with Walt Disney, was one of the many journalists and personalities who declared that he should receive an Academy Award for his work.

On March 20, 1948, Baskett received an Academy Honorary Award for his performance as Uncle Remus.

He was the first African-American male actor to win an Academy Award. Additionally, Baskett was the last adult actor to receive an Honorary Oscar for a single performance.

Since its original release, "The Song of the South" has remained a subject of controversy. Some critics have described the film's portrayal of African Americans as racist and offensive, maintaining that the black vernacular and other qualities are stereotypes. In addition, the plantation setting is sometimes criticized as idyllic and glorified. Because of this controversy, Disney has not released "The Song of the South" on any home video format in the United States, nor is it available on its streaming platform Disney+. Some of the musical and animated sequences have been released through other means, and the full film has seen home video distribution in other countries. The cartoon characters from the film have continued to appear in a variety of books, comics, and other media. The Disney theme park ride Splash Mountain was originally based on the film's animated sequences when it opened in 1989.

In 2003, the online film critics community ranked the film as the 67th best animated film of all time.

But all the old regalias of the film did not save the film from accusations of inculcating racial prejudices. The same claims were made by anti-racist activists to the water attraction based on film "The Song of the South".

Correct Tiana

In the wake of the protests surrounding the Floyd case, a petition was published on Change.org, which said that the trip to Splash Mountain "is saturated with extremely problematic and racist stereotypes." Approximately 20,000 signatures were collected in support of demands to revise the design of the attraction, after which the management of The Walt Disney Company considered it best to comply with the demands of the activists.

According to the company, the waterslide will be redesigned in the style of the movie "The Princess and the Frog".

"Tiana is a modern, bold and determined woman who follows her dreams and never loses sight of what really matters," reads a message posted on the company's website. "The new concept is comprehensive, allowing all of our guests to communicate and be inspired by it, and speak volumes about the diversity of the millions of people who visit our parks each year."

What is so special about the 2009 film compared to the 1946 film? The fact is that the main character of "The Princess and the Frog" Tiana is african american.

Disney Animator Mark Henn stated: "The heroines of our films have changed over time. Previously, they were just "princesses in trouble", like Snow White - victims of unfortunate events who did not have power over their own destiny. It was easy to fall in love with such heroines. Tiana is a completely different story; she has a goal, strong motivation, she is able to make decisions, and this is what makes her interesting and attractive. "

The waterslide in Disney parks will now correspond to the correct understanding of the place of african americans in the modern world.

It's time to fix mistakes
Judging by the comments on the company's website, the changes caused quite conflicting feelings among the Americans themselves.

"Bravo! That's the right decision. Disney is doing the next right thing. We're going to miss Splash Mountain, but it's time to fix the bugs associated with using the problem movie on the ride, "writes a user named Jackie.
"I am very sad that Disney is giving in to pressure again. There was nothing wrong with this ride and most people weren't even aware of the topic. It was such a fun and happy trip with great music, nothing can replace it. I will not ride the new attraction. With all these changes, I can stop visiting Disneyland altogether, "says user Sharon.

The fate of the Splash Mountain attraction, located in Japan, is unclear. As far as know, no one there complained about the water slide, but it is possible that racial reforms will take place there. Although, based on the course taken, for Japan, Disney would be worth looking for a heroine with an Asian appearance.

By the way, the 6-year-old daughter of the deceased Floyd Gianna is a Disney shareholder. The shares of the company were presented to the girl by the American actress and singer Barbra Streisand.

If this goes on, then in children's amusement parks, white heroes will only meet in a kneeling position, bringing repentance over the years of humiliation on racial, gender and other grounds.
(https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on January 04, 2022, 09:12:20 AM
How many and which disk devices are in your system
A simple utility (https://wasm.in/styles/smiles_s/yes3.gif)
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 09, 2022, 11:44:45 PM
Analog watch
; GUI #
include win64a.inc
W = 256
H = 256
.code
WinMain proc
local hbrBackground:qword
local msg:MSG

xor ebx,ebx
mov esi,IMAGE_BASE
mov edi,offset AppName
mov qword ptr[rsp+28h],LR_LOADFROMFILE
mov [rsp+20h],rbx
mov edx,offset BmpName
        invoke LoadImage,esi,,0,0
invoke CreatePatternBrush,eax
mov hbrBackground,rax
mov ecx,offset FileName
invoke LoadCursorFromFile
push rax ;hIconSm
push rdi ;lpszClassName
push rbx
push hbrBackground
push rax ;hCursor
push rax    ;hIcon
push rsi ;hInstance
push rbx    ;cbClsExtra & cbWndExtra
pushaddr WndProc  ;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX
push rbx
push rsi ;rsi=400000h
shl esi,9 ;rsi=CW_USEDEFAULT
push rbx
push rbx
push H+20;rsi
push W
push rsi
push rsi
sub esp,20h
mov r9d,WS_OVERLAPPED or WS_VISIBLE or WS_CAPTION or WS_SYSMENU
    invoke CreateWindowEx,0,edi,edi
mov hWin,rax
lea edi,msg
@@: invoke GetMessage,edi,NULL,0,0
invoke DispatchMessage,edi
jmp @b
WinMain endp
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local ps:PAINTSTRUCT
local hdc:HDC
local hpen:DWORD
local hPenOld:DWORD
local hBrush:DWORD
local hBrushOld:DWORD
local X:DWORD
local temp2:DWORD
local Time:SYSTEMTIME

mov hWnd,rcx

cmp edx,WM_CREATE
je wmCREATE
cmp edx,WM_PAINT
je wmPAINT
cmp edx,WM_DESTROY
je wmDESTROY

leave
        jmp NtdllDefWindowProc_

wmDESTROY: invoke  timeKillEvent,hTimer
invoke RtlExitUserProcess,NULL
wmCREATE:mov qword ptr[rsp+20h],TIME_PERIODIC
mov r8d,offset TimeProc
        invoke  timeSetEvent,1000,1000,,777
mov hTimer,rax
lea ecx,Time
invoke GetLocalTime
movzx eax,Time.wHour
mov ecx,12
xor edx,edx
div ecx
cvtsi2ss xmm0,edx
movss Hour,xmm0
movzx eax,Time.wMinute
cvtsi2ss xmm0,eax
movss Minute,xmm0
movzx eax,Time.wSecond
cvtsi2ss xmm0,eax
movss Second,xmm0
mulss xmm0,const1_60
addss xmm0,Minute
movss Minute,xmm0
mulss xmm0,const1_60
addss xmm0,Hour
movss Hour,xmm0
jmp wmBYE
wmPAINT:lea edx,ps
invoke BeginPaint;,hWnd
mov hdc,rax
invoke CreatePen,PS_SOLID,2,6464FFh;(255,100,100)
mov hpen,eax
invoke SelectObject,hdc,eax;hpen
mov hPenOld,eax
invoke MoveToEx,hdc,H/2,W/2,NULL
movss xmm0,temp;pi/30
mulss xmm0,Second
movss temp2,xmm0
invoke cosf
mulss xmm0,Second_arrow
cvtss2si eax,xmm0
mov X,eax
movss xmm0,temp2
invoke sinf
mulss xmm0,Second_arrow
cvtss2si edx,xmm0
add edx,H/2
mov r8d,W/2
sub r8d,X
invoke LineTo,hdc
invoke DeleteObject,hpen
invoke CreatePen,PS_SOLID,7,808080h;(128,128,128)
mov hpen,eax
invoke SelectObject,hdc,eax
invoke MoveToEx,hdc,W/2,H/2,NULL
;------------------------------------------------------
movss xmm0,temp;pi/30
mulss xmm0,Minute
movss temp2,xmm0
invoke cosf
mulss xmm0,Minute_arrow
cvtss2si eax,xmm0
mov X,eax
movss xmm0,temp2
invoke sinf
mulss xmm0,Minute_arrow
cvtss2si edx,xmm0
add edx,H/2;119
mov r8d,W/2;119
sub r8d,X
;-------------------------------------------------------
invoke LineTo,hdc
invoke MoveToEx,hdc,W/2,H/2,NULL
;------------------------------------------------------
movss xmm0,Hour
mulss xmm0,temp1;pi/6
movss temp2,xmm0
invoke cosf
mulss xmm0,Hour_arrow
cvtss2si eax,xmm0
mov X,eax
movss xmm0,temp2
invoke sinf
mulss xmm0,Hour_arrow
cvtss2si edx,xmm0
add edx,H/2;119
mov r8d,W/2;119
sub r8d,X
;-------------------------------------------------------
invoke LineTo,hdc
invoke SelectObject,hdc,hPenOld
invoke DeleteObject,hpen
invoke CreatePen,PS_SOLID,3,0AAAAAAh;(170,170,170)
mov hpen,eax
invoke SelectObject,hdc,eax
mov hPenOld,eax
invoke CreateSolidBrush,505050h;80,80,80
mov hBrush,eax
invoke SelectObject,hdc,eax;hBrush
mov hBrushOld,eax
invoke Ellipse,hdc,123,123,135,135
invoke SelectObject,hdc,hBrushOld
invoke DeleteObject,hBrush
lea edx,ps
invoke EndPaint,hWnd
wmBYE: leave
retn
WndProc endp
TimeProc proc uTimerID:QWORD,uMsg:QWORD,dwUser:QWORD,dw1:QWORD,dw2:QWORD
        movss xmm0,const1
addss xmm0,Second
movss Second,xmm0
movss xmm0,Minute
addss xmm0,const1_60
movss Minute,xmm0
movss xmm0,Hour     
addss xmm0,const1_3600     
movss Hour,xmm0
invoke InvalidateRect,hWin,0,TRUE
        leave
        retn
TimeProc endp
;-----------------------------------------------------------
.data
Second      dd ?
Minute      dd ?
Hour        dd ?
const1_60   dd 0.0166666666666666666666666667;1/60
const1_3600 dd 0.0002777777777777777777777778;1/3600
temp        dd 0.1047197551196597746154214461;pi/30
temp1       dd 0.5235987755982988730771072305;pi/6
Second_arrow dd 100.0
Minute_arrow dd 75.0
Hour_arrow  dd 50.0
AppName     db 'Wristwatch',0
FileName    db "br_Rabbit3.cur",0
BmpName     db "clock256.bmp",0
hWin dq ?
hTimer dq ?
const1 dd 1.0
end
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 09, 2022, 11:46:50 PM
Digital watch
asm-file; GUI #
include win64a.inc
TIMER_ID = 10
IDB_MYBITMAP   equ 100
.code
WinMain proc
local msg:MSG

xor ebx,ebx
mov esi,IMAGE_BASE
mov edi,offset AppName
mov ecx,offset FileName
invoke LoadCursorFromFile
push rax ;hIconSm
push rdi ;lpszClassName
push rbx
push COLOR_WINDOW
push rax ;hCursor
push rax    ;hIcon
push rsi ;hInstance
push rbx    ;cbClsExtra & cbWndExtra
pushaddr WndProc  ;lpfnWndProc
push sizeof WNDCLASSEX;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX
push rbx
push rsi ;rsi=400000h
shl esi,9 ;rsi=CW_USEDEFAULT
push rbx
push rbx
push 110+10
push 403+10
push rsi
push rsi
sub esp,20h
mov r9d,WS_OVERLAPPED or WS_VISIBLE or WS_CAPTION or WS_SYSMENU
    invoke CreateWindowEx,0,edi,edi
lea edi,msg
@@: invoke GetMessage,edi,NULL,0,0
invoke DispatchMessage,edi
jmp @b
WinMain endp
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local ps:PAINTSTRUCT
local hdc:dword
local Time:SYSTEMTIME
local hMemDC:dword

mov hWnd,rcx

cmp edx,WM_CREATE
je wmCREATE
cmp edx,WM_PAINT
je wmPAINT
cmp edx,WM_DESTROY
je wmDESTROY
cmp edx,WM_TIMER
je wmTIMER
leave
        jmp NtdllDefWindowProc_

wmDESTROY:;уничтожаем таймер #10
invoke KillTimer,,TIMER_ID
mov ecx,hBitmap
invoke DeleteObject
invoke RtlExitUserProcess,NULL
wmCREATE:invoke SetTimer,,TIMER_ID,1000,NULL
invoke LoadBitmap,IMAGE_BASE,IDB_MYBITMAP
mov hBitmap,eax
wmTIMER:lea ecx,Time
invoke GetLocalTime
movzx eax,Time.wSecond
mov [rsp+20h],rax
movzx r9d,Time.wMinute
movzx r8d,Time.wHour
mov ecx,offset buffer
lea edx,fmtstr
invoke wsprintf
invoke InvalidateRect,hWnd,NULL,TRUE
jmp wmBYE
wmPAINT:lea edx,ps
invoke BeginPaint;,hWnd
mov hdc,eax
        invoke CreateCompatibleDC,eax
mov hMemDC,eax
mov edx,hBitmap
invoke SelectObject,eax
     
xor edi,edi
sub esp,40h
@@: mov eax,hMemDC
mov [rsp+28h],rax
and qword ptr[rsp+38h],0
mov qword ptr[rsp+40h],SRCCOPY
movzx eax,buffer[rdi]
and eax,0Fh
imul eax,53
mov [rsp+30h],rax
mov qword ptr[rsp+20h],82
imul edx,edi,49
invoke BitBlt,hdc,,0,53
inc edi
cmp edi,7
jbe @b     
add esp,40h
invoke DeleteDC,hMemDC
lea edx,ps
invoke EndPaint,hWnd
wmBYE: leave
retn
WndProc endp
.data
AppName  db 'Timer',0
FileName db "br_Rabbit3.cur",0
fmtstr   db "%02d:%02d:%02d",0
hBitmap  dd ?
buffer   db 50 dup(?)
end
rc-file#define IDB_MYBITMAP 100
   IDB_MYBITMAP BITMAP "03.bmp"
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 15, 2022, 08:46:25 PM
Do the examples work or not? Do you have any wishes or suggestions?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 20, 2022, 10:11:00 PM
Does the timer02 program under Windows 10 have an indicator displayed on the screen? Why are you silent?
There ara asm-/rc-/exe-files timer02a.exe, timer02b.exe, timer03c.exe executables were assembled with resources and indicators are normally displayed under Windows 7 and 10 in the attachment. To make exe work both under "seven" and under "ten" I had to remove the permission to write to the .code (.text,W) section and the alignment /ALIGN:16 from the bat-file The difference between timer02a.exe, timer02b.exe, timer03c.exe
1.When creating a resource in timer02a.rc, the BITMAP type resource has the name "MYBP1"MYBP1 BITMAP "03.bmp"in timer02a.asm.data
aMYBP1 db "MYBP1",0
.code
mov edx,offset aMYBP1
invoke LoadBitmap,IMAGE_BASE
mov hBitmap,eax

2. When creating a resource in timer02b.rc, a BITMAP type resource is identified by number (100)#define MYBP1 100
MYBP1 BITMAP "03.bmp"
timer02b.asm MYBP1 equ 100
.code
invoke LoadBitmap,IMAGE_BASE,MYBP1
mov hBitmap,eax

3. When creating a resource in timer02c.rc, a resource of type BITMAP is associated with the number 100, but which is described as the string100 BITMAP "03.bmp" in timer02c.asm .data
aMYBP1 db "#100",0
.code
mov edx,offset aMYBP1
invoke LoadBitmap,IMAGE_BASE
mov hBitmap,eax
Title: Re: Uncle Remus Tales
Post by: HSE on February 21, 2022, 12:42:18 AM
Hi Mikl__!timer02a.obj : error LNK2001: unresolved external symbol __imp_AddIntegrityLabelToBoundaryDescriptor
timer02a.obj : error LNK2001: unresolved external symbol __imp_AddSIDToBoundaryDescriptor
timer02a.obj : error LNK2001: unresolved external symbol __imp_AddSecureMemoryCacheCallback
timer02a.obj : error LNK2001: unresolved external symbol __imp_AdjustCalendarDate
timer02a.obj : error LNK2001: unresolved external symbol __imp_AllocateUserPhysicalPagesNuma...


Look like includes and libraries don't mach.

How to make package new installation?
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 21, 2022, 08:48:02 AM
Hi, HSE!
Title: Re: Uncle Remus Tales
Post by: Mikl__ on February 21, 2022, 08:49:19 AM
Hi, HSE!
Title: Re: Uncle Remus Tales
Post by: HSE on February 21, 2022, 10:38:29 AM
Hi Mikl__!!

:thumbsup: :thumbsup: Timers are builded and working now.

Thanks, HSE.


Title: Re: Uncle Remus Tales
Post by: jj2007 on February 21, 2022, 10:43:11 AM
They look good, Mikl, but all three versions flicker a bit...