Sign in to follow this  
Followers 0
mesale0077

from binary read

9 posts in this topic

#1 ·  Posted (edited)

thank you for help me

binary read problem

why ?

Edited by mesale0077

Share this post


Link to post
Share on other sites



mesale0077,

It is not as easy as that! :P

To display a picture from data within the compiled exe, you can do one of 2 things:

- 1. Store the image as a resource in the compiled exe and then use Zedna's Resources.au3 to get the control to display it.

- 2. Save the raw data inside your file (as you were doing) and then use the streaming picture function written by Prog@ndy and Zedna.

To play the sound file, you have only one choice:

- 1. Convert the sound to wav format, save it as a resource and use Zedna's Resources.au3 to play it. You cannot do this with an mp3 file, you must convert it first.

Here is some code to show you how to do this:

First saving both image and sound as resources:

#include <GUIConstantsEx.au3>
#include "resources.au3"

#AutoIt3Wrapper_Res_File_Add="Your_Wav_File_Path", sound, "MY_SOUND_WAV"
#AutoIt3Wrapper_Res_File_Add="Your_Jpg_File_Path", rt_rcdata, "MY_IMAGE_JPG"

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)
$Pic1 = GUICtrlCreatePic("", 80, 64, 457, 265)
_ResourceSetImageToCtrl($Pic1, "MY_IMAGE_JPG")
$Button1 = GUICtrlCreateButton("play wav", 80, 360, 201, 57)
$Button2 = GUICtrlCreateButton("Exit", 328, 360, 225, 57)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $Button2
            Exit
        Case $Button1
            _ResourcePlaySound("MY_SOUND_WAV", $SND_ASYNC)
    EndSwitch
WEnd

And now using the streaming image function - the sound is still saved as a resource:

#include <GUIConstantsEx.au3>
#include "resources.au3"

#AutoIt3Wrapper_Res_File_Add="Your_Wav_File_Path", sound, "MY_SOUND_WAV"

Global $LOGO = _LOGOBin()

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)
$Pic1 = GUICtrlCreatePic("", 80, 64, 457, 265)
_SetImageBinaryToCtrl($Pic1, $LOGO)
$Button1 = GUICtrlCreateButton("play wav", 80, 360, 201, 57)
$Button2 = GUICtrlCreateButton("Exit", 328, 360, 225, 57)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $Button2
            Exit
        Case $Button1
            _ResourcePlaySound("MY_SOUND_WAV", $SND_ASYNC)
    EndSwitch
WEnd

Func _LOGOBin()
    Local $pic = "0x"
    $pic &= "FFD8FFE000104A46494600010200000100010000FFE0001C4F636164245265763A2031383837312024000000000000000018FFDB008400030404060806080808080808080808080A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0C0F0C0C0C0E0C0C0C0D110D0E0F101011100C0C12131210130F1010100103080810101010101010202020202040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040FFC00011080146020003012200021101031101FFC4009C00010002010501000000000000000000000002080301040506070901010100000000000000000000000000000002100002010302030306090708040710000000020301040506120711221331321421515262820815234142617292A21617718191B2F0243373A1A3C2C3D2435383D41825273463C4F1264445465455646574859394A4C1D3E11101010100000000000000000000000000001101FFDA000C03010002110311003F00FAA6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000439D3D24C010E74F48E74260086EA7A473A130063ABD3D2479D3F8A198018F753F8A1AEEA130043753D23753D24C010DD4F48E74EE260086EA7A4D3753BF99AD7BAA78264B8D5A1ED666826CEE3D644ABD19566ED363236C7577837ED7DE07BC6F5E7DFE71DA2FA4AF9F9FEE1F579F2CFE3F9FD6D2FF0090E369F08DE1D5796DCF5B56BF5C574BFE0816639D06EA7A4ACD3FC21387AA8CD5CF5AD7653CF455BA91ABF61121DECFF60DAA7C23F876DCAAB9667E75E9D96394939B7B967ED0168F750D3753F8A158E9F087D05DDF195C73EAA72F8AF2DE6F73C8CCB5F845681E55AD72570B4A7A719965FF00A98165F753F8A13E656CB7F84268093BB331A7D735BDEC4BFDB428731F9F0D095FFC61C4D7F4DD2FF900F78E74EF35E743C7E9C59D1955AB7E50E12AB4EFAD32564BFE319538AFA36BE1D4183AFE8C9D87FF00980F5DE643753F8A1E609C4CD275EECFE12B5F47C6567FE73B543A971527F377D6727D99E26FEF81D9B9D3D239D0E392FAD5A9CD668AB4FA9D4DCC73C6D4E965AFE8AEE0371CE9E91CE9E930F3A7B437D7EA03373A0E7423BE869DA27A69FB409F3A0E7430F6D4F597F68DF5FA80D77D2BFF0061A7694FAFBB9F714E75FD84B9ED798AC1532192C6C36785BFC9CCF613B5B5C3B4B7096112F6A9BD19D1D647F07819CE93ABF845776971858AD7516AFBCADFE76D6DEEE973969645A63FB2B99AF1BE45136F440A9BDFE9B2017FEAEBCB9D6A43B45E5BB9F9BD3C8F9EBC21E1556FB4963EFD3506A8B09AE9EEA58E96B92658521F28992D97B2D8E8C8F12C4EE8FD7BF7F5A780E332BA475763B596234EC3AA73F5C1E6D2F2E9A79278A4C8A4D670BBDCC2978E8EEA9FCC3FA9F2AFD0EE9D61F477B65AD39F31DA2FA7E7E5DC507E1EE3B5E47799EADA6764C8B637505D5AF90E65A59E39ECEAB6B35BCA97B0A76D6B71D948DBD1217877B26F8536163345EBF8F3135E59CD6B36332D8D6856FAC6678A568DA554749629607D92C4E8CDB264F577BA2746F0F6DED16BF398E922FD7DFCBB98DE0036D5917D3FD43B55FAFF0061B9006CEB2AFEEFCDEB9B8DD4FE286400439D0D2AF4F4990010DD4214AD2BFF0061980187753F8A0AD69FC50CC00DB5645EFAD7FA89D6B4FE28660061DEB5F9C9EEA130063DD4FAC8F68BDDCCCC00852BCE9CC990A77130000000000000000000000000000000003C3B8B99392CB46E7AE22665963C65D766C95D8C924D13C292A3A785D1DB7EF3A261B877A7A5B297136D8EA635B1AF15B49774B1B25B8B86892D9D2E2296E6DA686E22993723BBA3BEFDE9D06F3E1010F6DA2EF6D69E77BDBAC4DAAD29E2AB4B92B3475FB1B37166A9DE079543C3FD3C9755B85C658539AC5458FC8ECA8A8C8CFD48E90EFDEFB911FAF67C927B7BFBFB626CEA944AC11563A57751362EDDDEB1CE00367E4D17AB426E9CE9FF00ECDC8030F2FAEBFB4872A7B46E40186B4FD26CBC8A1FF571FDD3930075FF0089AC7ABF935BF9FBFE497CE71D5D2F88AF9AB8FB2AD39F3F3DBC5E2FB87710079E4FA0B4DCB4F94C3E2DF9776FB2B56FEE1C3C9C2CD18F5E6DA7304D5F4D71B64DFE09EB600F1393837A15BCEDA730BFAACA08FF00710E16F780BC3FB8A727D3D8F5FE863681BEFC2E8586005554F838E8056DD4C64D4AD3CFCE991CA79993D4FE59FBE6E53E0F9A3E2769ACE2C863AE9FBAEED329938EE91BE9B23BDCBA7DF472D0802AE5380F855A6F8F29A952F6BE2BF5CCDEF95BFB2EFBFB1FC065FCCA279E94D55AD56BDFCE99C95BF03A3967801585F82B5ABEEFCACD6D4A7265DB4CC6D5FB5FCC9BAFCD8E67772FCB2D4B5B7A22D15695B0EDA9F6E5F23EAFB9BCB2800A7371C19CEC3979B2D8ED5D9183213DBC76AF35DD8E36F6B5B78BAD15D36429E35F1A26FEAFB67996273599C8661F1167C54B5BABF5A6FA429A7EC1A37D9D6EB14AEFD8CAE89CDDD11DDD36BFA8E5B9E22E3EF2EB4C662DECB735E4F8CBF8E054AED91E4785D12247DE9B5DDF6A6F3E1F68ED2F9B9B3B07C5A994B97C3B5ACB74D6B0B25ED8468C934D14515D3A279424AD3C31C3BFE59D5FA3A885BEB641A5F89B6B0AB5B6A5C55EB529CA91DEE196D23DBFD2E3EE5CE02F74FF001424C8596436E8B96F2CA2BA8A069299B8D516E7B1F28A6CED9D3AD235EB74DFD3ED9D33426BBE2A476D2B5FE9ABFCC40F733F93DC"
    $pic &= "DCCD6184BFF27F022DC63DFE9F4ABEFF00A1B9FADD3639EEF6DC46CD2C5BAEF486A181B7EDAD20AD85EAD1BD6E8BC47D9F610B43C7F4EE97E2CE36F32576B4D1F3364EFD6EAE12B2E595B722243B6297674A6C8D5F63EFFEE1A66F4E7115F50E3B505B63F0715DE3D67B79E18F2570D2642C5F66FB5B895ECD13623AEF81DDFA1FADD1DCB7B86CC2DED9C373D8DCC14968DF2775035B5C2756CEB89FAD4EDC0554A6B7E267276AE88B7A6CA7997F282CFB476E7E247EC766CE5F41F67DB37B071275755794DA232CB253C548EFB1B24746F61FB64DC859E36DB2BF50158DF8B992879D27D1FAB68E9BB7521B5B5BA5AAFCDB2586F112BEE239BA878E16558B7CF83D5B68DF3ADC60EF3753FF00828E9F8CB27C97D26E00AB35F842E945E7E51F1B5B73FE6BB6C4E4A3EDBFA2D90BEEF7F61B6B8F843E8F876A4F264EDE7AEDEC209B177F1CB73BFC1D96F87ABDF74DE5A9E5F5D48D539FA7F681579FE11BA1219690DCDFDD59CF4A7CA5BDC63728B709ECBA791BFEF9CB597C20787D71E1CF5AC75F9E970B3DB353DCB9850B17B3E7F3F3FD26DA4B58A4A75AD1A9E8AF501E7569C4CD272D76C59FC24CDE85C959C8DF81CEE78DCDD8DDA55ADAE6DAE694EFAC332C9FB8751BFE1DE96B86A35C60F0F7155F0D66C7DAC8D4F6537A1D0B33C09D097C8BDA60AC6064F3AB59AB59488DF41BF91763BBDF02C4768BE921DB53D65FDA5579F8038BE4BE479BD538CA2F7D2CF313AABF57433F6FDB783D8D8619784FA86DABDB62B5AEA18EE9ABF28D90A5AE560AAA746D8AD1D11227F6D3DF02DB82A736338B16F4A24591D3190A454DAAF796B7B6D2CF4EDBC52A59BBC2AFB3D44D89EA278CDF5757F122D5556E349D9646B4AF267B0CCC51F4FAC915EC28EDF7C0B460AA737193276BB52FB466AC47F9EB67696F928E8BEB76B6D36CFC0723071FF46F68905F5D5D622E5E8D5F27CA59DE594945F59DDE1EC7F18166C1E598BE22696BD7D9699AC55D49CB9D238AFAD6493EE23EF3D369252A0660000000000000000000000000000000000015938D523F93E9DB655A356FF5869F85B9D7C11C533DE3B7F61F88B2E855AE203CB3EB8D158FE55AC297396C94D45A783C86C365B33BFF004B3B27BC5A6A77013000000000000000000000000000000000000000036F48686E0010DB41B684C0000000000000000000000000000000001B7E4BE938CB9B382786B1CD1A4D1C94E554929B96BEE39CD803E7EEA6D278689ADD6FF45E36E23B8973315171B651477570CF7490E2D6296DA6445966B3ED2F26777448515DD1D1D361D2786B25C694CD5F49BE6FC98BFCFE4F0D4A3B33478CBAB3BD74C76F77777F279A26685E7D9D0FB37BF426FF00A5B250F9E5C43469785FADB6726A7E52649A95E7D3B62CEC2EFB3DBE96FBA07D124F0FCFDDF3998C094E5E8E54A7CC6700000000000000000000000000000000029CEB9CE458FE21E949EE79C305DDAE531D4AD23ED77DC5C35B76516C4EB5DEEABD7B3626EEBD9BDF65C04AF328E6B5D2F69A838A3658DC9D679EC71DA65B2304493341B2EDF25E4CF376B06C9BC0AAFD0E9D7127D02F0724ECAB45A536EDAD36F87979BC3CBCDB7FAB901B90429DC4C000000000000000000000000000000000000000000000000000000000000000000000000000000061AF7807EE3E73DE5FD2EF80F90BC6A726BCAE5AE5B9FF00E939F9A6FBFB194EFBC577E24C36D9092CA45AD9531B3B51F1F14104F1F4BEF6796EAF1265744DDB1E1477F5111CF2DD5EEF61C1DC259763616D67954C5DBCF731F95496F6F6F78CF7897A913A76F34AFE37444DE8ECFD0E9B00FA614EE266CE1A36C5DF5E6DC979D796DE6C6F000000000000000000000000000000116EE2445BB80ACD8C8BB7E29E5AE3BFC8B4D626D6B5F435CDEDE5E22FF6659B2B3693911F889ABAA95F3A58697A48BE991E2BF7467FB08CBF78B320000000000000000000000000000000000000000000000000000000000000000000000000000000000000756D435A2E36F19BC14B6BAAB7D9EC5CA319B46FC89E156EF17E51688AF3E7BBA5ED5F67E0DA5BFE24C958F49E7A55E5568B0D947A52BF3B2594C55DD6302C3A5B86317D18752E8B4A5796DF0594C9FDD02F547E05FD0A6E4C11F857F4299C00000000000000000000000000000106266197B80AD7C365866D41AD2FD68ACEF9E8ACAAD1FCEB8EC6DAA227DB47924F7D9CB3454DE004BCF4CC9DA36FBCF8E732F7B72B4F93B9BAF8C26DF324BFE951D1A3D8FF004F6BA7D02D900000000000000000000000000000000000000000000000000000000000000000000000000000000000001E59C4FE75D1FA87D3F11E5B97FF0025315CB5A2525C470D61DB5A37E50E9A9ABF4B9793584D36DFC47BFF0015E4DBA3350B55E895F89B28946AFCDBED5CF2FCF5935BDF70F20969C9E0BF68996BF348982B94FDF502D5A72DBF5723318D7C3FA8C8000000000000000000000000000000C1357A4CE6C2FA4D96F237AAB5AFF5015AFE0EA9FF0027F88AF52D1AB919568DD2DD9CD92BF789BDF46572D195E380FE7D01A7ABFF00AB62A72F4B233961C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000AF3C797AA680D42DE9C6B47FA77B227F78DA6BE965FCAAD128BE17CC6519BCDF49315789FB8CC43E101BEBA132AB1D69CE4AD8455AD7C3B65BFB647DFEC6C66387D7AF5FCE0E804ABF2E736A86AD3D3B31ABD5BFE8F8BC1ED7B005ABA1A98E9DDFA8C80000000000000000000000"
    $pic &= "00000000EB5A971CF798ABCB4496B6F25CDADCC29353FD134B0BC6B253ECD6BCCECA6293B80A3BF06AD5F7F90C13E3A5C6D6DA1C25571EB774936F6D243F465B37F96865446577EBD9BD9F66C7E82F3958F8111A47A66B0ECA23C197CF44FB69DEC992B9EADFEC236C2CE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000159BE108F48F4165DF7ECD9E40DCFD3B3256CFB7DFF07BC70FC40AF3E2570FBE6F3EADA72FFDDA9FE5FC4727F0809695D19730F3A524BABCC3C312D7AB7C8F95B3DEBEE22B10E225A53F2E342DD77562BFCE5BF3FF00DA71B33FF86059DA777EA3210A7713000000000000000000000000000000636FFEE643A76AFCF458BC35EE4A55AC91D85B5C5CBC6B5A2B48B0C2F25511ABE16AD29E6A815DB80590B59ECF378F5912B363750E53B4557AF6BB26BCB8786493CD4AAD5AAB2252B4E9644AF2A539B16E8AA9C01E1EDE6171F7B777B22796E7268EFA7B5485235B3693B596902CBE7965A2D26E55A55BB346A35129BAB2BC96AC00000000000000000000000000000000000000000000000000000000000000000000000000000000010AF754990AF7540A3FC66F2E7CFE9E4915E98D4CD69F9E2BA6665B582E21BDB95BC4BB4851F776DBAD123DFB3649BDF7A2239CFEB5BC59B895A46C64928B0C30E5AF5523A2C924974913C28B71D7BE18B6769B1FAF7CDBD367D34EC3ADE8B7DADB4BE2DBB396DED9F259AB84AD3AA36B187C9AC6547F62E2E99FEDC49EA1C0DDE25AE78B96D736EF32FC5DA71697AD47A2ABACD7B3791C3B3C6CEFB6477DFD1D30FB005BB4F0D3D1C8CC63A7EBFD664000000000000000000000000000000794F143E26934DDEDA656FEDB1B6990864B4EDEE268A1E4F2C52557B3ACAEAAF2AEDAC944E7CEB446AFCC7AB15D7E107886BCD0399448925961B7ADC47B9636D9D97548E9DA73A2BF65DA252AB4AB75568BCAB5E740F06E10EA2CBE6B5534ED259CC984C6790E4329673CB25AE65A6749AC5BB2744489E1DB72EEE9BF63CAE89B11D10FA06798691D3781B6C779460E086DEDB2958AFBE4AADD8CBDB4112A32273648E3AC548E8B1C5454A529C968BBAB53D3C0000000000000000000000000000000000000000000000000000000000000000000000000000000000042BDD502B563ED6B3714727755DDCB1DA6717674F3F4EEBEBFB9B976FEC17EE8D2F7AB73C46D555A6E5A5863F4ED9D6B4A6E8E4675BCBFDFBFD849153DE34D0EB349AD75A5D33D6B124F81B28FEA6B4C7BDCCCA9EFDDB10E1B43BB526B6B96F3D5B396B0D2BE95B3C6DB6C5F7372816669DC4CC34F0F9FFACCC000000000000000000000000000000C32A5197954CC00A97649A934856482CB1B366F4D56496686DED9A3F8D315DA3BBC96B140DB12F2DA8ECAD1528EB2474774AB48888EFCD5DFC22347DAAD297F2643193F4EFB7BEC664A0962DD4A32D24AD2D59295AAD79D2AACCB5F379F95799652BDE538CADDCBAE2F1B1966F5FC96B39D7E33BC4FFC2B7114A8FF0016D94BF4ADD1D77CD729D0FD089B13ADC3DDB446B1C865ED9EEA6C4CB8CB779795A2DC4ADE55341CFA679ADEB0AF9351E9D48ACEF56A73EEF352BEAE6D1E8FB7A7956BF59B8A77013000000000000000000000000000000000000000000000000000000000000000000000000000031B990DA4D22AA559ABCA89E7A815A78278F8E9619ABE57DF165B546A2BD8F9D7FD1F96BDB22FB49FC999FDE3170724ACD73ABEE7CEB4935865A255A752D56DA2B3B6ED53DF5637BF07DB778F87D83ED5A8CF3437570D5AD3BDAF2F66B9FF001148F026E167C25FDC72A53CA750EA097CDF3ABDFCC0598A770AF70A7713000000000000000000000000000000744D61A924C659C73478DC8E5259AE63B78E0B08964915A457AD2591A4748E18968B5A34AED45A559295F150EF641BB80A3F82BAD41ADE4C8C7916F8930D8ECA5D63EEB1B6B2B497B792DBAA35C5ADDDEC3D0B6CFDA2A3A5B75BA34E9BF66C72E16371B6B696D1DB5B431DBC10A2A45144AB1C691A7815113C28511D3D2EAFC76B4D5189C243889AD9B2A99A75CB56EADEEA75C8AA3CAB64F06F4689258EA893BA3A23FAEEFB0FA0D444F5BE6E7E6AFF005F980DC830F4F7F3FD7E63300000000000000000000000000000000000000000000000000000000000000000000000001A54D4000797711AF9AD74A672E22AF2960C465258EBE2E52456533A7EE9EA2576E3CDE343A035132FCF8F963AFF00B66487F7180E7F8489D9E89D38B4E7E7C2625BCFEB3DAC2EFB3EF1E79F0709E9368B8AE3B967C966655A72DAB457BF99FA3D83D52F2D7B0D21241E51E4548708D1794FFE4DB2CB676DEE78FDD3A2701645934069F68AD2B674A586CECEBD3CE446747B8F0782E5D7CA7FDAFD302C8D3B89800000000000000000000000000000008D7BABFAC911602AB5294FCF33D694F3D343454A7D9F8E9F796ACAA95A7FCB4AB2D79F3D0ACB5A7A153349FE62D5800000000000000000000000000000000000000000000000000000000000000000000000000000380BDB958219667A3ED891A4AED5691BA3D444EB6FB073E42BDD503C123E33E8AAF65FF1EE363ACDBB6ADC4FD8494D8CE8FDAA4E88F13EF564D936CF09E29C79D73A6323A2AFAC6CF338CBA9EFA7C65BC696B7904F26EF2FB677E885DF6A244B239ED5AC7831A4B3CF593238C824B96E7BAE62DD04F56F4BCB0ECDDEFA395A17E0A90D9BB362F21673A511FB2B7CB62ED6F96ACFD69BEE11E17FC0E9"
    $pic &= "EC01EBBC6ED7D8BC7E07338E912E67BCB8C35E35218616916182F166B34B8B899DD12289E56D9E3DFE3D88E7B470FF0018D6BA630D6ACF4692D7158C86465EA5AB456B0A3ECF61F69F19327C2CCB5C68A8B52DAA5AC38C852495A17BBBC96EABB27F239A5449A148151E55699111F7EC6F1BBA1F6AF4522AE0319454A469F17D9728E94DAA8BE4E9D24523D02846BDC4A86A58000000000000000000000000000011624637EE02AD528EDC6477A72D916885A357DA9735BD3F0465A92AC6989D6E789BA9D929CBC8311A7ED64AF3EF9255B9BC46FB8CBF74B42FFAFF008AD3F8FEAF9C0CC000000000000000000000000000000000000010AF7540983C3B2BC4CB2B296459F1D9EDB1C8D1D648F177B3C3554FA48F0A3A6CF6CAE1AF7E137616F0259E0ED67BECC4F3AC4B6D756B790762DB5366F8B624D34AEFB51214747DEDE3F06F0FA000F9CBA03E141156EA6B3D574B3C6CEA8F247716BDAC96B5AEED9E4EE89DB3ACA88ADD6933A78D1F64C9B1EF35AEA5C64F8C8F2497707904B1ACAB70CDD9C558DFC0DBDFC2077407018FCA59DDA335B4F04E8B5DB568655923A37ABBD0E7C000000000000000000000000000001D7335925B4B0BABA6A56B4B682596B4A7B0BBCEC6797711ADEE25D33964B6E55B8F20BAAC34AD76F391177A7E3502A062F1F1DDFC1F9A3AEEAD13057B352BED59DC4D73F737C6A5D7D22F47C2635B6B2F3B0B2AD28DE2A7C8A14FF1B2C163C056ACD5AED7D3574AB5AFCF25F2CC912A6FF6E55F0172F4D2ECC4D8A569CAB1D9DAA579FF00448076DA1A90A771300000000000000000000000000000045BB89003E74F106EB2BA778910E4AD32185B18F51E3A5B791B291DC47689258AC2FBAE5E099374AFD3B267D9B11B67DBEFD65C68BF8295F2FC9E83BEDBBABBAC75079349B7FA2BA47467F63B62D664F4EE32F76797595A5E522AF38E9710453ECFB1BD3A4EB14E1AE91A752E03094AFA698EB3FF00201E7D6BC79D194B5492EF318DB59AB4E7240B7715DB47ECEFB5DE8DEE182BF08FE1CF3E5F1FDBF9FF00E82F5BFC13DCACB018EB55DB6B676B6EB4EE58E08A25A7DC43B05235F557F601597FE10FA11D6BD9E525979D5A8B58B1D94916BEFA59BA31C947C79D20FF00CD4F929FFA3C3E59BDDFF999623657EA35DBFC7302BDD78CB8DAC7CE3C66A797EA8F039266FBEF0EC38BFCF7FABA4F5BCDCFE75C2B46BFDB4C8598AC74AD3CFE7148D7D5A0157BF3E52D797FDC7EB8F3D7FF00332FFBE1C845C60B891B6AE8FD6B5AFA5B1D6B1FE37BC42C8F25F48E4BE903C11F89D7F4F33690D554FB30E2DB9FFF005E7133F17AE6356AB690D63CE955A725C7DAC8BEE6CBCEA2CB6DA18B92FA40ABCFC71977EDFC8ED73FA3E2556FC7E59B092F1AAE76F4E8ED6ACDCFB9B19147FBF78E59EEC69EAAFEC35E4BE902B4C5C59CC4ADB22D17AA6ADE99A2B3817EFCD73B0E77F381A8BCFCF46673EAFE55896FFAF9EF1B2BF519B6D00AF94E206A4E5BBF23339FAEEB13FEF9BCDA3F137389E2D17A8E9B7BF636364FDCBCEA2C76DA187657EA02B449C66BA55EBD1DAD68DDDF278D8255FC1786CE9C724DF547D29ADE1A53CD466C2CACB56F7267DC5A4E4BE9215823F56805674E3E60FBA7C76A4B66A7D19B0D7AAD4FB88E6C2BF093D088BBE5BEBAB78EBD3BA6C7E495777AA9B2D9D0B53B2BF5153BE11C9CF87F944E4EF5924C72F674AB6E7DF92B37D89E34DEFE047D8E89E0034FF85070D2AD4FF8E2B5E5DD5AD8E4BFDD8EB7A8F883C26D4F6C91DDE5ED775AC8B2DBCD57BAB1BAB599D5364D692BA23ABA6D5E84DE9BD51DD3A0F21D57F058D138AC5DC642E33396B482DA8B596692382F151772227C9436C8EDE25F01D2B0FC35E0FDCDBC52C5AA5D7A9A924970B67691BB2743FC95ED826DF12F46FF00A440B0BA1E7E1261A365B3CE6366BA9F6F6F777D7914F733326FD9BE499123544E75F022274A6F472C249C4CD0D24758E4D41A79E3AF9B6BE46C196BEE6F2A053827A16E9916CF5161A4DFE14ADBE1A567F7ED7638CB7C1B6C208E2E6BA527964AED5ADC479BB1EDF675F425B661D19F67A8858BAFA7B39A5E58DBE2BBCC4BC75AEE6F239ED596ADEB3F62E7A1C73232EE56A353EAAEE3E4AEBDE0B79063ADAA9A4F0D49E7C8585BC725967B28CD334D708896E916411117B6F06FDFD1BB79E0F8DE1DCB6F248974D4C45CF96D847163EE27BC8B33247717F0DB53647D8C30DD5BECED1FB6B64DFBD53DB421798FBD5CFF004FEC27BA8571AF02F4B6DE48B968DA9DCD1E672CCDF8EE761C7C3C1DBA82ACF65AB355DBB569C9639AFE2C85BD17D88AF617FDF2D0B420AC74D05AFA393745ADEAD1FA97381C6C9F8E1785C9CD6FC578F9AC579A46E569DCF359652091FEDA4372E8A05990569AE5B89F0455924C369DBD6A53F9BB5CA5D5B33FD8F2AB3D8BEFB9863E266A4820DF92D179C81AB4F32E3E7C6E597A3FA1B985D7EE01670157FF003E5854877DF63F51E296B4F3D6F30D7D1AA6CF5DE147FDF3B3E178CFA1F22AB4B5CEE36AD2799639A65B692ADEAF6575B1FF00001EF20E0ECF256D3AEE8668E6A569CE8D1B2C9D3EE1CCEEA01304375098000003C7B8A15DBA3B50B55EB1D6984CB568FE86F259B6783D4396CFEA88717263FCA51E905F5E792B5CEE558EDA475778BB5F61DD7B1DFEBB27AE759E295D41F911A824F34D1D70992E5CABD2EAF6AFB3AD3D7DCAE0555E205E4CFC20C2E1E1B49EB7394C7E97B65A32B2C56CCF2D9ECED657F0EF78F62278FAB7FD03E88474DB4DBF350F943F95D95BEB3D1386BCB9C7DAC51E474EA4"
    $pic &= "91D25C92E4DFB186178BCAECE7B685E549A58D552787B68526D89DA3F99CFACA804E846BDC4A86A00000000000000000000000000000000000000000000000000000000000000000000000000AB3F08C86B270F737B6B4E689672B5776DE986F2CE675DFEBEC56D9EDEC2D3158FE1170F6BC39CF2F2E7CADA27FD1D95D42FF00DD02C640EAC8AD4E7E7A73A7336D1D9411F6958E345ACAFBE4AD176EF6F59FD63716D5A5634AD3BAA8BC8E440F3BC9E85D3979CDAF3118BBAAFCF5B8B2B595BEFBA1E7D3F03F424AF495B4FE368F4AAB79A1D8BEFA23EC64F60B0A00AC9C63A5776948D295EBD6384F3529D355896E66EBFB1D9EFF0074E278D9B569A42BB1773EB6D3B173E4BE1ED9DDD7EFC6A72DC629E8975A3AB5AD3CFACF174F32F68DD76B7E9E0F7BC7F43C6713C70A55E6D17072A5647D6F839694FF00A385667940B5717857F4198C29DC660000006DEB4A7AA6E001B6D95FA8EAF99D3389C8C4B1E46CACEFD17AA8B736F15CAD1BD644991CEE200ADD7BC02E1FDCF367C0DA273AEEAD61ACB6ED4EADFD0F6D326DF70DAC9C0EC646AA98FCB6A7C4C695E744B2CCDE7674FF006575DB2166C0155E3E1FEBFB7929E4FAE2496DA3A728E1BDC3595CC955F565B849A177FB66E5ABC58B79AB4A7E4A64AD97BABCB25637527DBFE7A05FBE59F005665E216B0B6491F21A2EF6B1C74E7BB1B91B3C833FD8B7778666F711CF3FD47C53D27791C3F1A5D6A5D2B7695E50C935BE4B1B2233FAEE90BDACA9D3E09D1D0BA754E66BB280519C2C384B8B35C341AA71398C7DFC7E4F7769E571477103223ECB8C4A23BBC5F2AAAFE4CFBD11FAE174D9B1FA0EB7B1D4D8FD0D96B778952D2E6B1594CADB956DAE26BFB5B67B8C5C4FE2B1BC8A46992DBA3C8E669913A3A12E5653867A4EF5DE4B9C262AE24936EE91ECA0692BB3D4951379E3B91F834684B88DD21B3BAC7D64DD566B3BD9D79B746CF9299E687A1EBBD3626C47503C432BA534C2E6F4FE074BE396F3218ACFE3AEF2D7CB1C52B5A59DA4AFBD6F2F5FA3B57DBFCCA3F5F63B1D37EC43E9621E5BA5346E27058F8EC31D6D586DE3AA379957749222A23CEEFE396574E8767EB745DA9D08887AB010A7713214EE26000000000000000000000000000000D0D4000000000000000000000000000000000000000001E21AFB5F43A7EDED679AD6F2F1AEEF62B5892D21ED65AB3C534DE0774DCE891B3EC4EB7DDB113C6E9533881C6AB0CB62B546356B17C5B2E35698DCA2B3793DC5D3D82649ECA6DFFF0037B874664811F66F78264F1A6C2D7712F49C798C646AD909B16F61796F928AEA18D64EC64B3DEE8CE8FD0C89E3FB6A9E3F0155B88BAB38752683CF5D62D2D6F299999A36A5BC0D497E3492199E1BAB88A6D8F6FB120926DEE89BF6BBA6FDE05E2D1F91F2DC0E2AEEBDF738FB2B8AF9BFD6DBA3FF0078E6B2190B5B5B796E2EA78EDA1869BA49A695638E35F59DDFA14E89C31AD3F23F4FD39D39530D86A53AB77FDE50FD3FA4558E23710B079C9B0F888FB6AD29ABB171CD6B7903451642D62BD9ACE568B7F45DDBA5DED474EB7DEAFBD3A00BE50CD1C88AE8D4AA569CD6B4AF4D54E44ABDC229AB695CE606AD1F2C0E5E58AD22DCD568F1B7A897D62AEEEEEFD092C889EC45B3E81DFEDB889807CF4B82A6422AE5A04DCD6EDDAC6CFF0024936D4774D8CE9136F74477744EB7F03EC0E83C558249327A4288D5B793F2960FE574A6E68D52D6E6696DD3AD1FF94A2B43F4D36349BD3A10E3B8D095ADF689AD6B454A6B1C775FA1B6DCBA43EFEDD9EE9975D6771B7593D295B7B982E61B7D5CD6D3764CB22A5E458DBF4485EA9E17476F07B4751F841C997AC3A657118BBCC9DD41A8AC7211521859ED91AC566D915C4A9FCD23F6EBB1FC1B2299F7A6CEB0B40F9EC746F774ADDDAAD6C23596F2959957C9A3DAEE8D71FEA5362B3EF7FA0A761B5BC867892689D64864456475AEE5757F0323945F1DF0799B236D7971A8F2F77266729476C8C7693F6565274A258ACB6E889DB259BC7BD3C09BD7E9A275F79D35ACB5662F176D6B95D2394AC5616B6B6BE518EB8B3C835CC914288F2A592324CB13ED674D9BFC5B1F60172015F6DB8B38E9A78218F1BA85A696448DA95C2DFC4B0B3B78A579A14454FA7E373DFE9DC04C00000000000000000000000000069435214EE26000000000000000000000000000000000000000000000000000000000000000000000000079AEACD3ED95C7BDA2DF5FE3D99D6B49ACE458E4A6CFA2FBD1D1A27DDD68E9D68796627823A72DA5C54B25BB5D5DE1ED7C963BA97A649E1ECA68516E123D892EC46644E8E84D9D6FB0B3A00F9C97DF074CBC765778DC7677CA71F948F170DD2E496E249A1B7C75D3CD6CB68F0BEC5444DA888E9B1FAF63A6F4D9E9563C0AB7F22BFC54D792498DF8C56FF113528DF18E32E1DBB69BF94CC8E92C5BD55D1FE9EE9F7EF7D8E974410295F103863A965CFDCE4B4FE416CDB376B6B6393E7596378D61951D3256EF0F435C242BE4C88E9BD119DD1FADDD38CB1E0F66B6E6EDAEF27DB4926431D93C2E59A35F2B82F2DA0EC3B5BB8551119D12382199FAFB64677744777D979C163E3EE7F496ADD2ED698BB0C7DEE5254D456196B2BCEC567B6BABAF8BFB1B8597B1EBB774B9DCFB1DFAE0FA69D8EF7B058FD19C41C8667333DDE4EE71596B24C4A632E6DAAED879A3EC674BB5F2474D92A3D7ADD1D37C33323A3BA743DFDDB41B680515C4E36D743EA2BE92FA5CACF8ECCD859CB265A55BABE93E30B29A64962BB7851DD7B58AE6374774444DAE88FBD1DCB39A575C"
    $pic &= "6073693362AFE0BC582AB49B66E5ECD9F7EC57474E9F0FE13D3B6D0981B7D9D26E000000000000000000000000000000000D286A000000034035000000D00D41A1A8006800D41A003504799A57957BFCFF00A809821CA8395009831F2A1AF2A013063E54FD44762FAB4FD8066061E54FABD3DC4B6D3D14FD8064061D8BEAD3F613E540260C3B17D5A7EC25CA9F5019018F6D0D795009821CA842A8B5A79E94FD8066061A22FCD4A7EC3300043950972035043950972035043950972035063DB427C80D41A721C80D418EB4A57BCD795009821CA8395009821CA8395009821CA8395009834E44795009831F2A1AF2A013063DB435E540260872A1A72A7D406404395072A01A53F5FEB32000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFD9"
    Return $pic
EndFunc   ;==>_LOGOBin

Func _SetImageBinaryToCtrl($CtrlId, ByRef $Binary) ;Authors: Prog@ndy, Zedna

    Local $hData, $pData, $pStream, $pBitmap, $hBitmap
    Local Const $STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0, $SS_BITMAP = 0xE, $GWL_STYLE = -16

    Local $picdata = Binary($Binary)
    Local $piclength = BinaryLen($picdata)
    Local $picstruct = DllStructCreate("byte[" & $piclength & "]")
    DllStructSetData($picstruct,1,$picdata)
    Local $picmemory = DllStructGetPtr($picstruct)
    $hData = _MemGlobalAlloc($piclength,2)
    $pData = _MemGlobalLock($hData)
    _MemMoveMemory($picmemory,$pData,$piclength)
    _MemGlobalUnlock($hData)
    $pStream = DllCall( "ole32.dll","int","CreateStreamOnHGlobal", "int",$hData, "long",1, "Int*",0)
    $pStream = $pStream[3]
    _GDIPlus_Startup()
    $pBitmap = DllCall($ghGDIPDll,"int","GdipCreateBitmapFromStream", "ptr",$pStream, "int*",0)
    $pBitmap = $pBitmap[2]
    $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($pBitmap)
    Local $hWnd = GUICtrlGetHandle($CtrlId)
    If $hWnd = 0 Then Return SetError(1, 0, 0)
    Local $oldStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE)
    If @error Then Return SetError(2, 0, 0)
    DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "long", BitOR($oldStyle[0], $SS_BITMAP))
    If @error Then Return SetError(3, 0, 0)
        Local $oldBmp = DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hWnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
    If @error Then Return SetError(4, 0, 0)
    If $oldBmp[0] <> 0 Then _WinAPI_DeleteObject($oldBmp[0])
    _GDIPlus_BitmapDispose($pBitmap)
    _GDIPlus_Shutdown()
    _WinAPI_DeleteObject($pStream)
    _MemGlobalFree($hData)
    DllStructSetData($picstruct,1,0)
    $picstruct = ""

EndFunc

As you can see, the first is much shorter! :party:

You will, of course, need the full version of SciTE4AutoIt3 to use the Wrapper directives (you can download it here) and Zedna's UDF (you can download it here).

I hope that answers your question. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

thank you ok

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thank you for help me

binary read problem

why ?

sndPlaySound

;http://msdn.microsoft.com/en-us/library/aa910369.aspx WAVE

;http://msdn.microsoft.com/en-us/library/aa909803.aspx

LoadImageFrom_BinaryData

#Include "Data.au3"

Data.rar

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>
#Include "Data.au3"

Const $SND_MEMORY  = 4, $SND_ASYNC = 1 ,$SND_SYNC = 0,$SND_NODEFAULT = 2
Global $LOGO1 = _LOGOBin() ;file jpg name a.jpg
$Array = LoadImageFrom_BinaryData($LOGO1)
$HandleImage = $Array[1][1] ;$ImageArray[0][1] = "HBITMAP"
Global $misc1 = WavFile() ;file WAVE
$ByteStruct = DllStructCreate("BYTE[" & StringLen($misc1) / 2 & "]")
DllStructSetData($ByteStruct,1,$misc1)
$BytePtr = DllStructGetPtr($ByteStruct)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)
$Pic1 = GUICtrlCreatePic("", 80, 0, 457, 265, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
STATIC_SETBITMAP($Pic1,$HandleImage)
$Button1 = GUICtrlCreateButton("play sound", 80, 360, 201, 57, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Exit", 328, 360, 225, 57, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE,$Button2
            Exit
        Case $Button1
;http://msdn.microsoft.com/en-us/library/aa910369.aspx WAVE
$fuSound = BitOR($SND_MEMORY,$SND_ASYNC,$SND_NODEFAULT)
sndPlaySound($BytePtr, $fuSound)
    EndSwitch
WEnd

;http://msdn.microsoft.com/en-us/library/aa910369.aspx WAVE
;http://msdn.microsoft.com/en-us/library/aa909803.aspx
Func sndPlaySound($lpszSound, $fuSound)
    Local $Type = "str" , $BOOL
    if IsPtr($lpszSound) Then $Type = "ptr"
    $BOOL = DllCall("winmm.dll", "int", "sndPlaySound",$Type,$lpszSound,"UINT",$fuSound)
    If @error Then Return SetError(1, 0, 0)
    Return $BOOL[0]
EndFunc

Func STATIC_SETBITMAP($hWnd,$HandleImage)
Local $GWL_STYLE = (-16) , $SS_BITMAP = 0x0000000E , $SS_ICON   = 0x00000003 ,$STM_SETIMAGE = 0x0172
If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
if Not BitAND(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), $SS_BITMAP) = $SS_BITMAP Then
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) + $SS_BITMAP )
ElseIf  BitAND(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), $SS_ICON) = $SS_ICON Then
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) - $SS_ICON)
EndIf
Return _SendMessage($hWnd, $STM_SETIMAGE, 0, $HandleImage)
EndFunc

Func LoadImageFrom_BinaryData($BinaryData , $GDIPlus_ShutDown = True)
; $GDIP_IMAGETYPE_BITMAP - Bitmap types: BMP, PNG, GIF, JPEG, TIFF, ICO, EXIF [Return HBITMAP Handle AND  imageobject[Bitmap Handle]]
;$GDIP_IMAGETYPE_METAFILE - Metafile types: EMF, WMF [Return HENHMETAFILE Handle  (AND\OR) imageobject]
;$GDIP_IMAGETYPE_UNKNOWN [Return new object]
Local $tSize = StringLen($BinaryData) / 2
Local $DATA = DllStructCreate("byte[" & $tSize & "]")
DllStructSetData($DATA,1,$BinaryData)
Local $uFlags = 0x0002 , $dwBytes = DllStructGetSize($DATA)
Local $hMemory = DllCall("Kernel32.dll","HANDLE","GlobalAlloc","long",$uFlags,"long",$dwBytes)
if @error Then
Return -1
Else
$hMemory = $hMemory[0]
if $hMemory = 0 Then Return -1
EndIf
Local $hLock = DllCall("Kernel32.dll","ptr","GlobalLock","HANDLE",$hMemory)
if @error Then
Return -2
Else
$hLock = $hLock[0]
if $hLock = 0 Then Return -2
EndIf
Local $Destination = $hLock , $Source = DllStructGetPtr($DATA), $Length = $dwBytes
DllCall("Kernel32.dll","none","RtlMoveMemory","ptr",$Destination,"ptr",$Source,"long",$Length)
if @error Then
Return -3
EndIf
Local $fDeleteOnRelease = True , $Status , $ppstm , $Error
Local $Error = DllCall("Ole32.dll","int","CreateStreamOnHGlobal","ptr",$hLock ,"int",$fDeleteOnRelease,"ptr*",0)
if @error Then
Return -4
Else
if Not ($Error[0] = 0) Then Return -4
$ppstm = $Error[3]
EndIf
Local $gdiplusOpen = DllOpen("gdiplus.dll")
Local $ImageType = 0 , $ImageWidth = 0 ,$ImageHeight = 0 , $struct_GdiplusStartupInput , $Input , $LPInput , $VOID _
, $LPVOID_token , $Status , $HBITMAP , $HENHMETAFILE , $GdiPlus_Dll_Hwnd , $GdiPlus_Token
$struct_GdiplusStartupInput = _
"int GdiplusVersion;" & _
"int DebugEventCallback;" & _
"int SuppressBackgroundThread;" & _
"int SuppressExternalCodecs;"
$Input = DllStructCreate($struct_GdiplusStartupInput)
DllStructSetData($Input,"GdiplusVersion",1)
DllStructSetData($Input,"DebugEventCallback",0)
DllStructSetData($Input,"SuppressBackgroundThread",0)
DllStructSetData($Input,"SuppressExternalCodecs",0)
$LPInput = DllStructGetPtr($Input)
$VOID = DllStructCreate("int")
$LPVOID_token = DllStructGetPtr($VOID)
$Status = DllCall($gdiplusOpen,"int","GdiplusStartup","ptr",$LPVOID_token,"ptr",$LPInput,"ptr",0)
if @error Then
Return -5
Else
if Not ($Status[0] = 0) Then Return -5
$LPVOID_token = $Status[1]
EndIf
Local $stream = $ppstm , $image = 0
$Status = DllCall($gdiplusOpen,"int","GdipLoadImageFromStream","ptr",$stream,"int*",$image)
if @error Then
Return -6
Else
if Not ($Status[0] = 0) Then Return -6
$image = $Status[2]
EndIf
$Status = DllCall($gdiplusOpen,"int","GdipGetImageWidth","HANDLE",$image,"int*",0)
if Not @error Then
if $Status[0] = 0 Then $ImageWidth = $Status[2]
EndIf
$Status = DllCall($gdiplusOpen,"int","GdipGetImageHeight","HANDLE",$image,"int*",0)
if Not @error Then
if $Status[0] = 0 Then $ImageHeight = $Status[2]
EndIf
$Status = DllCall($gdiplusOpen,"int","GdipGetImageType","HANDLE",$image,"int*",0)
if Not @error Then
Local $CaseMsg = $Status[2]
Select
Case $CaseMsg = 0
$ImageType = "ImageTypeUnknown"
Case $CaseMsg = 1
$ImageType = "ImageTypeBitmap"
$Status = DllCall($gdiplusOpen, "int", "GdipCreateHBITMAPFromBitmap", "HANDLE", $image, "int*", 0, "int", 0)
if Not @error Then
if ($Status[0] = 0) Then $HBITMAP = $Status[2]
EndIf
Case $CaseMsg = 2
$ImageType = "ImageTypeMetafile"
Local $metafile = $image
$Status = DllCall($gdiplusOpen,"int","GdipGetHemfFromMetafile","HANDLE",$metafile,"int*",0)
if Not @error Then
if ($Status[0] = 0) Then $HENHMETAFILE = $Status[2]
EndIf
EndSelect
EndIf
if $GDIPlus_ShutDown = True Then
DllCall($gdiplusOpen,"int","GdiplusShutdown","ptr",$LPVOID_token)
DllClose($gdiplusOpen)
$GdiPlus_Dll_Hwnd = 0
$GdiPlus_Token = 0
Else
$GdiPlus_Dll_Hwnd = $gdiplusOpen
$GdiPlus_Token = $LPVOID_token
EndIf
Dim $ImageArray[2][8]
$ImageArray[0][0] = "imageobject"
$ImageArray[0][1] = "HBITMAP"
$ImageArray[0][2] = "HENHMETAFILE"
$ImageArray[0][3] = "ImageType"
$ImageArray[0][4] = "ImageWidth"
$ImageArray[0][5] = "ImageHeight"
$ImageArray[0][6] = "GdiPlus Dll HANDLE "
$ImageArray[0][7] = "GdiPlus Token"
$ImageArray[1][0] = $image
$ImageArray[1][1] = $HBITMAP
$ImageArray[1][2] = $HENHMETAFILE
$ImageArray[1][3] = $ImageType
$ImageArray[1][4] = $ImageWidth
$ImageArray[1][5] = $ImageHeight
$ImageArray[1][6] = $GdiPlus_Dll_Hwnd
$ImageArray[1][7] = $GdiPlus_Token
return $ImageArray
EndFunc
Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

wolf9228,

Bravo - one for the snippet folder! :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

For the sake of correction, you can play sound formats other than wave from resources. I've seen programs that even store tracker module data and play that.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

Here my version playing 3 chip tunes and displaying background image of GUI from memory -> http://www.4shared.com/file/i9azoS--/Audio__Image_from_Memory.html

Sorry, cannot upload it through AutoIt because attachment space is not enough (1 MB only)!

BR,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

wolf9228,

Bravo - one for the snippet folder! :mellow:

M23

Mistake in this UDF library

See here

$_SS_ICON = 0x00000003

$Pic1 = GUICtrlCreatePic("", 80, 64, 457, 265,$_SS_ICON)

Try this code

#include <GUIConstantsEx.au3>
#include "resources.au3"

#AutoIt3Wrapper_Res_File_Add="Your_Wav_File_Path", sound, "MY_SOUND_WAV"

Global $LOGO = _LOGOBin()

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)
$_SS_ICON   = 0x00000003
$Pic1 = GUICtrlCreatePic("", 80, 64, 457, 265,$_SS_ICON)
_SetImageBinaryToCtrl($Pic1, $LOGO)
$Button1 = GUICtrlCreateButton("play wav", 80, 360, 201, 57)
$Button2 = GUICtrlCreateButton("Exit", 328, 360, 225, 57)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $Button2
            Exit
        Case $Button1
            _ResourcePlaySound("MY_SOUND_WAV", $SND_ASYNC)
    EndSwitch
WEnd

Func _LOGOBin()
    Local $pic = "0x"
    $pic &= "FFD8FFE000104A46494600010200000100010000FFE0001C4F636164245265763A2031383837312024000000000000000018FFDB008400030404060806080808080808080808080A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0C0F0C0C0C0E0C0C0C0D110D0E0F101011100C0C12131210130F1010100103080810101010101010202020202040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040FFC00011080146020003012200021101031101FFC4009C00010002010501000000000000000000000002080301040506070901010100000000000000000000000000000002100002010302030306090708040710000000020301040506120711221331321421515262820815234142617292A21617718191B2F0243373A1A3C2C3D2435383D41825273463C4F1264445465455646574859394A4C1D3E11101010100000000000000000000000000001101FFDA000C03010002110311003F00FAA6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000439D3D24C010E74F48E74260086EA7A473A130063ABD3D2479D3F8A198018F753F8A1AEEA130043753D23753D24C010DD4F48E74EE260086EA7A4D3753BF99AD7BAA78264B8D5A1ED666826CEE3D644ABD19566ED363236C7577837ED7DE07BC6F5E7DFE71DA2FA4AF9F9FEE1F579F2CFE3F9FD6D2FF0090E369F08DE1D5796DCF5B56BF5C574BFE0816639D06EA7A4ACD3FC21387AA8CD5CF5AD7653CF455BA91ABF61121DECFF60DAA7C23F876DCAAB9667E75E9D96394939B7B967ED0168F750D3753F8A158E9F087D05DDF195C73EAA72F8AF2DE6F73C8CCB5F845681E55AD72570B4A7A719965FF00A98165F753F8A13E656CB7F84268093BB331A7D735BDEC4BFDB428731F9F0D095FFC61C4D7F4DD2FF900F78E74EF35E743C7E9C59D1955AB7E50E12AB4EFAD32564BFE319538AFA36BE1D4183AFE8C9D87FF00980F5DE643753F8A1E609C4CD275EECFE12B5F47C6567FE73B543A971527F377D6727D99E26FEF81D9B9D3D239D0E392FAD5A9CD668AB4FA9D4DCC73C6D4E965AFE8AEE0371CE9E91CE9E930F3A7B437D7EA03373A0E7423BE869DA27A69FB409F3A0E7430F6D4F597F68DF5FA80D77D2BFF0061A7694FAFBB9F714E75FD84B9ED798AC1532192C6C36785BFC9CCF613B5B5C3B4B7096112F6A9BD19D1D647F07819CE93ABF845776971858AD7516AFBCADFE76D6DEEE973969645A63FB2B99AF1BE45136F440A9BDFE9B2017FEAEBCB9D6A43B45E5BB9F9BD3C8F9EBC21E1556FB4963EFD3506A8B09AE9EEA58E96B92658521F28992D97B2D8E8C8F12C4EE8FD7BF7F5A780E332BA475763B596234EC3AA73F5C1E6D2F2E9A79278A4C8A4D670BBDCC2978E8EEA9FCC3FA9F2AFD0EE9D61F477B65AD39F31DA2FA7E7E5DC507E1EE3B5E47799EADA6764C8B637505D5AF90E65A59E39ECEAB6B35BCA97B0A76D6B71D948DBD1217877B26F8536163345EBF8F3135E59CD6B36332D8D6856FAC6678A568DA554749629607D92C4E8CDB264F577BA2746F0F6DED16BF398E922FD7DFCBB98DE0036D5917D3FD43B55FAFF0061B9006CEB2AFEEFCDEB9B8DD4FE286400439D0D2AF4F4990010DD4214AD2BFF0061980187753F8A0AD69FC50CC00DB5645EFAD7FA89D6B4FE28660061DEB5F9C9EEA130063DD4FAC8F68BDDCCCC00852BCE9CC990A77130000000000000000000000000000000003C3B8B99392CB46E7AE22665963C65D766C95D8C924D13C292A3A785D1DB7EF3A261B877A7A5B297136D8EA635B1AF15B49774B1B25B8B86892D9D2E2296E6DA686E22993723BBA3BEFDE9D06F3E1010F6DA2EF6D69E77BDBAC4DAAD29E2AB4B92B3475FB1B37166A9DE079543C3FD3C9755B85C658539AC5458FC8ECA8A8C8CFD48E90EFDEFB911FAF67C927B7BFBFB626CEA944AC11563A57751362EDDDEB1CE00367E4D17AB426E9CE9FF00ECDC8030F2FAEBFB4872A7B46E40186B4FD26CBC8A1FF571FDD3930075FF0089AC7ABF935BF9FBFE497CE71D5D2F88AF9AB8FB2AD39F3F3DBC5E2FB87710079E4FA0B4DCB4F94C3E2DF9776FB2B56FEE1C3C9C2CD18F5E6DA7304D5F4D71B64DFE09EB600F1393837A15BCEDA730BFAACA08FF00710E16F780BC3FB8A727D3D8F5FE863681BEFC2E8586005554F838E8056DD4C64D4AD3CFCE991CA79993D4FE59FBE6E53E0F9A3E2769ACE2C863AE9FBAEED329938EE91BE9B23BDCBA7DF472D0802AE5380F855A6F8F29A952F6BE2BF5CCDEF95BFB2EFBFB1FC065FCCA279E94D55AD56BDFCE99C95BF03A3967801585F82B5ABEEFCACD6D4A7265DB4CC6D5FB5FCC9BAFCD8E67772FCB2D4B5B7A22D15695B0EDA9F6E5F23EAFB9BCB2800A7371C19CEC3979B2D8ED5D9183213DBC76AF35DD8E36F6B5B78BAD15D36429E35F1A26FEAFB67996273599C8661F1167C54B5BABF5A6FA429A7EC1A37D9D6EB14AEFD8CAE89CDDD11DDD36BFA8E5B9E22E3EF2EB4C662DECB735E4F8CBF8E054AED91E4785D12247DE9B5DDF6A6F3E1F68ED2F9B9B3B07C5A994B97C3B5ACB74D6B0B25ED8468C934D14515D3A279424AD3C31C3BFE59D5FA3A885BEB641A5F89B6B0AB5B6A5C55EB529CA91DEE196D23DBFD2E3EE5CE02F74FF001424C8596436E8B96F2CA2BA8A069299B8D516E7B1F28A6CED9D3AD235EB74DFD3ED9D33426BBE2A476D2B5FE9ABFCC40F733F93DC"
    $pic &= "DCCD6184BFF27F022DC63DFE9F4ABEFF00A1B9FADD3639EEF6DC46CD2C5BAEF486A181B7EDAD20AD85EAD1BD6E8BC47D9F610B43C7F4EE97E2CE36F32576B4D1F3364EFD6EAE12B2E595B722243B6297674A6C8D5F63EFFEE1A66F4E7115F50E3B505B63F0715DE3D67B79E18F2570D2642C5F66FB5B895ECD13623AEF81DDFA1FADD1DCB7B86CC2DED9C373D8DCC14968DF2775035B5C2756CEB89FAD4EDC0554A6B7E267276AE88B7A6CA7997F282CFB476E7E247EC766CE5F41F67DB37B071275755794DA232CB253C548EFB1B24746F61FB64DC859E36DB2BF50158DF8B992879D27D1FAB68E9BB7521B5B5BA5AAFCDB2586F112BEE239BA878E16558B7CF83D5B68DF3ADC60EF3753FF00828E9F8CB27C97D26E00AB35F842E945E7E51F1B5B73FE6BB6C4E4A3EDBFA2D90BEEF7F61B6B8F843E8F876A4F264EDE7AEDEC209B177F1CB73BFC1D96F87ABDF74DE5A9E5F5D48D539FA7F681579FE11BA1219690DCDFDD59CF4A7CA5BDC63728B709ECBA791BFEF9CB597C20787D71E1CF5AC75F9E970B3DB353DCB9850B17B3E7F3F3FD26DA4B58A4A75AD1A9E8AF501E7569C4CD272D76C59FC24CDE85C959C8DF81CEE78DCDD8DDA55ADAE6DAE694EFAC332C9FB8751BFE1DE96B86A35C60F0F7155F0D66C7DAC8D4F6537A1D0B33C09D097C8BDA60AC6064F3AB59AB59488DF41BF91763BBDF02C4768BE921DB53D65FDA5579F8038BE4BE479BD538CA2F7D2CF313AABF57433F6FDB783D8D8619784FA86DABDB62B5AEA18EE9ABF28D90A5AE560AAA746D8AD1D11227F6D3DF02DB82A736338B16F4A24591D3190A454DAAF796B7B6D2CF4EDBC52A59BBC2AFB3D44D89EA278CDF5757F122D5556E349D9646B4AF267B0CCC51F4FAC915EC28EDF7C0B460AA737193276BB52FB466AC47F9EB67696F928E8BEB76B6D36CFC0723071FF46F68905F5D5D622E5E8D5F27CA59DE594945F59DDE1EC7F18166C1E598BE22696BD7D9699AC55D49CB9D238AFAD6493EE23EF3D369252A0660000000000000000000000000000000000015938D523F93E9DB655A356FF5869F85B9D7C11C533DE3B7F61F88B2E855AE203CB3EB8D158FE55AC297396C94D45A783C86C365B33BFF004B3B27BC5A6A77013000000000000000000000000000000000000000036F48686E0010DB41B684C0000000000000000000000000000000001B7E4BE938CB9B382786B1CD1A4D1C94E554929B96BEE39CD803E7EEA6D278689ADD6FF45E36E23B8973315171B651477570CF7490E2D6296DA6445966B3ED2F26777448515DD1D1D361D2786B25C694CD5F49BE6FC98BFCFE4F0D4A3B33478CBAB3BD74C76F77777F279A26685E7D9D0FB37BF426FF00A5B250F9E5C43469785FADB6726A7E52649A95E7D3B62CEC2EFB3DBE96FBA07D124F0FCFDDF3998C094E5E8E54A7CC6700000000000000000000000000000000029CEB9CE458FE21E949EE79C305DDAE531D4AD23ED77DC5C35B76516C4EB5DEEABD7B3626EEBD9BDF65C04AF328E6B5D2F69A838A3658DC9D679EC71DA65B2304493341B2EDF25E4CF376B06C9BC0AAFD0E9D7127D02F0724ECAB45A536EDAD36F87979BC3CBCDB7FAB901B90429DC4C000000000000000000000000000000000000000000000000000000000000000000000000000000061AF7807EE3E73DE5FD2EF80F90BC6A726BCAE5AE5B9FF00E939F9A6FBFB194EFBC577E24C36D9092CA45AD9531B3B51F1F14104F1F4BEF6796EAF1265744DDB1E1477F5111CF2DD5EEF61C1DC259763616D67954C5DBCF731F95496F6F6F78CF7897A913A76F34AFE37444DE8ECFD0E9B00FA614EE266CE1A36C5DF5E6DC979D796DE6C6F000000000000000000000000000000116EE2445BB80ACD8C8BB7E29E5AE3BFC8B4D626D6B5F435CDEDE5E22FF6659B2B3693911F889ABAA95F3A58697A48BE991E2BF7467FB08CBF78B320000000000000000000000000000000000000000000000000000000000000000000000000000000000000756D435A2E36F19BC14B6BAAB7D9EC5CA319B46FC89E156EF17E51688AF3E7BBA5ED5F67E0DA5BFE24C958F49E7A55E5568B0D947A52BF3B2594C55DD6302C3A5B86317D18752E8B4A5796DF0594C9FDD02F547E05FD0A6E4C11F857F4299C00000000000000000000000000000106266197B80AD7C365866D41AD2FD68ACEF9E8ACAAD1FCEB8EC6DAA227DB47924F7D9CB3454DE004BCF4CC9DA36FBCF8E732F7B72B4F93B9BAF8C26DF324BFE951D1A3D8FF004F6BA7D02D900000000000000000000000000000000000000000000000000000000000000000000000000000000000001E59C4FE75D1FA87D3F11E5B97FF0025315CB5A2525C470D61DB5A37E50E9A9ABF4B9793584D36DFC47BFF0015E4DBA3350B55E895F89B28946AFCDBED5CF2FCF5935BDF70F20969C9E0BF68996BF348982B94FDF502D5A72DBF5723318D7C3FA8C8000000000000000000000000000000C1357A4CE6C2FA4D96F237AAB5AFF5015AFE0EA9FF0027F88AF52D1AB919568DD2DD9CD92BF789BDF46572D195E380FE7D01A7ABFF00AB62A72F4B233961C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000AF3C797AA680D42DE9C6B47FA77B227F78DA6BE965FCAAD128BE17CC6519BCDF49315789FB8CC43E101BEBA132AB1D69CE4AD8455AD7C3B65BFB647DFEC6C66387D7AF5FCE0E804ABF2E736A86AD3D3B31ABD5BFE8F8BC1ED7B005ABA1A98E9DDFA8C80000000000000000000000"
    $pic &= "00000000EB5A971CF798ABCB4496B6F25CDADCC29353FD134B0BC6B253ECD6BCCECA6293B80A3BF06AD5F7F90C13E3A5C6D6DA1C25571EB774936F6D243F465B37F96865446577EBD9BD9F66C7E82F3958F8111A47A66B0ECA23C197CF44FB69DEC992B9EADFEC236C2CE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000159BE108F48F4165DF7ECD9E40DCFD3B3256CFB7DFF07BC70FC40AF3E2570FBE6F3EADA72FFDDA9FE5FC4727F0809695D19730F3A524BABCC3C312D7AB7C8F95B3DEBEE22B10E225A53F2E342DD77562BFCE5BF3FF00DA71B33FF86059DA777EA3210A7713000000000000000000000000000000636FFEE643A76AFCF458BC35EE4A55AC91D85B5C5CBC6B5A2B48B0C2F25511ABE16AD29E6A815DB80590B59ECF378F5912B363750E53B4557AF6BB26BCB8786493CD4AAD5AAB2252B4E9644AF2A539B16E8AA9C01E1EDE6171F7B777B22796E7268EFA7B5485235B3693B596902CBE7965A2D26E55A55BB346A35129BAB2BC96AC00000000000000000000000000000000000000000000000000000000000000000000000000000000010AF754990AF7540A3FC66F2E7CFE9E4915E98D4CD69F9E2BA6665B582E21BDB95BC4BB4851F776DBAD123DFB3649BDF7A2239CFEB5BC59B895A46C64928B0C30E5AF5523A2C924974913C28B71D7BE18B6769B1FAF7CDBD367D34EC3ADE8B7DADB4BE2DBB396DED9F259AB84AD3AA36B187C9AC6547F62E2E99FEDC49EA1C0DDE25AE78B96D736EF32FC5DA71697AD47A2ABACD7B3791C3B3C6CEFB6477DFD1D30FB005BB4F0D3D1C8CC63A7EBFD664000000000000000000000000000000794F143E26934DDEDA656FEDB1B6990864B4EDEE268A1E4F2C52557B3ACAEAAF2AEDAC944E7CEB446AFCC7AB15D7E107886BCD0399448925961B7ADC47B9636D9D97548E9DA73A2BF65DA252AB4AB75568BCAB5E740F06E10EA2CBE6B5534ED259CC984C6790E4329673CB25AE65A6749AC5BB2744489E1DB72EEE9BF63CAE89B11D10FA06798691D3781B6C779460E086DEDB2958AFBE4AADD8CBDB4112A32273648E3AC548E8B1C5454A529C968BBAB53D3C0000000000000000000000000000000000000000000000000000000000000000000000000000000000042BDD502B563ED6B3714727755DDCB1DA6717674F3F4EEBEBFB9B976FEC17EE8D2F7AB73C46D555A6E5A5863F4ED9D6B4A6E8E4675BCBFDFBFD849153DE34D0EB349AD75A5D33D6B124F81B28FEA6B4C7BDCCCA9EFDDB10E1B43BB526B6B96F3D5B396B0D2BE95B3C6DB6C5F7372816669DC4CC34F0F9FFACCC000000000000000000000000000000C32A5197954CC00A97649A934856482CB1B366F4D56496686DED9A3F8D315DA3BBC96B140DB12F2DA8ECAD1528EB2474774AB48888EFCD5DFC22347DAAD297F2643193F4EFB7BEC664A0962DD4A32D24AD2D59295AAD79D2AACCB5F379F95799652BDE538CADDCBAE2F1B1966F5FC96B39D7E33BC4FFC2B7114A8FF0016D94BF4ADD1D77CD729D0FD089B13ADC3DDB446B1C865ED9EEA6C4CB8CB779795A2DC4ADE55341CFA679ADEB0AF9351E9D48ACEF56A73EEF352BEAE6D1E8FB7A7956BF59B8A77013000000000000000000000000000000000000000000000000000000000000000000000000000031B990DA4D22AA559ABCA89E7A815A78278F8E9619ABE57DF165B546A2BD8F9D7FD1F96BDB22FB49FC999FDE3170724ACD73ABEE7CEB4935865A255A752D56DA2B3B6ED53DF5637BF07DB778F87D83ED5A8CF3437570D5AD3BDAF2F66B9FF001148F026E167C25FDC72A53CA750EA097CDF3ABDFCC0598A770AF70A7713000000000000000000000000000000744D61A924C659C73478DC8E5259AE63B78E0B08964915A457AD2591A4748E18968B5A34AED45A559295F150EF641BB80A3F82BAD41ADE4C8C7916F8930D8ECA5D63EEB1B6B2B497B792DBAA35C5ADDDEC3D0B6CFDA2A3A5B75BA34E9BF66C72E16371B6B696D1DB5B431DBC10A2A45144AB1C691A7815113C28511D3D2EAFC76B4D5189C243889AD9B2A99A75CB56EADEEA75C8AA3CAB64F06F4689258EA893BA3A23FAEEFB0FA0D444F5BE6E7E6AFF005F980DC830F4F7F3FD7E63300000000000000000000000000000000000000000000000000000000000000000000000001A54D4000797711AF9AD74A672E22AF2960C465258EBE2E52456533A7EE9EA2576E3CDE343A035132FCF8F963AFF00B66487F7180E7F8489D9E89D38B4E7E7C2625BCFEB3DAC2EFB3EF1E79F0709E9368B8AE3B967C966655A72DAB457BF99FA3D83D52F2D7B0D21241E51E4548708D1794FFE4DB2CB676DEE78FDD3A2701645934069F68AD2B674A586CECEBD3CE446747B8F0782E5D7CA7FDAFD302C8D3B89800000000000000000000000000000008D7BABFAC911602AB5294FCF33D694F3D343454A7D9F8E9F796ACAA95A7FCB4AB2D79F3D0ACB5A7A153349FE62D5800000000000000000000000000000000000000000000000000000000000000000000000000000380BDB958219667A3ED891A4AED5691BA3D444EB6FB073E42BDD503C123E33E8AAF65FF1EE363ACDBB6ADC4FD8494D8CE8FDAA4E88F13EF564D936CF09E29C79D73A6323A2AFAC6CF338CBA9EFA7C65BC696B7904F26EF2FB677E885DF6A244B239ED5AC7831A4B3CF593238C824B96E7BAE62DD04F56F4BCB0ECDDEFA395A17E0A90D9BB362F21673A511FB2B7CB62ED6F96ACFD69BEE11E17FC0E9"
    $pic &= "EC01EBBC6ED7D8BC7E07338E912E67BCB8C35E35218616916182F166B34B8B899DD12289E56D9E3DFE3D88E7B470FF0018D6BA630D6ACF4692D7158C86465EA5AB456B0A3ECF61F69F19327C2CCB5C68A8B52DAA5AC38C852495A17BBBC96EABB27F239A5449A148151E55699111F7EC6F1BBA1F6AF4522AE0319454A469F17D9728E94DAA8BE4E9D24523D02846BDC4A86A58000000000000000000000000000011624637EE02AD528EDC6477A72D916885A357DA9735BD3F0465A92AC6989D6E789BA9D929CBC8311A7ED64AF3EF9255B9BC46FB8CBF74B42FFAFF008AD3F8FEAF9C0CC000000000000000000000000000000000000010AF7540983C3B2BC4CB2B296459F1D9EDB1C8D1D648F177B3C3554FA48F0A3A6CF6CAE1AF7E137616F0259E0ED67BECC4F3AC4B6D756B790762DB5366F8B624D34AEFB51214747DEDE3F06F0FA000F9CBA03E141156EA6B3D574B3C6CEA8F247716BDAC96B5AEED9E4EE89DB3ACA88ADD6933A78D1F64C9B1EF35AEA5C64F8C8F2497707904B1ACAB70CDD9C558DFC0DBDFC2077407018FCA59DDA335B4F04E8B5DB568655923A37ABBD0E7C000000000000000000000000000001D7335925B4B0BABA6A56B4B682596B4A7B0BBCEC6797711ADEE25D33964B6E55B8F20BAAC34AD76F391177A7E3502A062F1F1DDFC1F9A3AEEAD13057B352BED59DC4D73F737C6A5D7D22F47C2635B6B2F3B0B2AD28DE2A7C8A14FF1B2C163C056ACD5AED7D3574AB5AFCF25F2CC912A6FF6E55F0172F4D2ECC4D8A569CAB1D9DAA579FF00448076DA1A90A771300000000000000000000000000000045BB89003E74F106EB2BA778910E4AD32185B18F51E3A5B791B291DC47689258AC2FBAE5E099374AFD3B267D9B11B67DBEFD65C68BF8295F2FC9E83BEDBBABBAC75079349B7FA2BA47467F63B62D664F4EE32F76797595A5E522AF38E9710453ECFB1BD3A4EB14E1AE91A752E03094AFA698EB3FF00201E7D6BC79D194B5492EF318DB59AB4E7240B7715DB47ECEFB5DE8DEE182BF08FE1CF3E5F1FDBF9FF00E82F5BFC13DCACB018EB55DB6B676B6EB4EE58E08A25A7DC43B05235F557F601597FE10FA11D6BD9E525979D5A8B58B1D94916BEFA59BA31C947C79D20FF00CD4F929FFA3C3E59BDDFF999623657EA35DBFC7302BDD78CB8DAC7CE3C66A797EA8F039266FBEF0EC38BFCF7FABA4F5BCDCFE75C2B46BFDB4C8598AC74AD3CFE7148D7D5A0157BF3E52D797FDC7EB8F3D7FF00332FFBE1C845C60B891B6AE8FD6B5AFA5B1D6B1FE37BC42C8F25F48E4BE903C11F89D7F4F33690D554FB30E2DB9FFF005E7133F17AE6356AB690D63CE955A725C7DAC8BEE6CBCEA2CB6DA18B92FA40ABCFC71977EDFC8ED73FA3E2556FC7E59B092F1AAE76F4E8ED6ACDCFB9B19147FBF78E59EEC69EAAFEC35E4BE902B4C5C59CC4ADB22D17AA6ADE99A2B3817EFCD73B0E77F381A8BCFCF46673EAFE55896FFAF9EF1B2BF519B6D00AF94E206A4E5BBF23339FAEEB13FEF9BCDA3F137389E2D17A8E9B7BF636364FDCBCEA2C76DA187657EA02B449C66BA55EBD1DAD68DDDF278D8255FC1786CE9C724DF547D29ADE1A53CD466C2CACB56F7267DC5A4E4BE9215823F56805674E3E60FBA7C76A4B66A7D19B0D7AAD4FB88E6C2BF093D088BBE5BEBAB78EBD3BA6C7E495777AA9B2D9D0B53B2BF5153BE11C9CF87F944E4EF5924C72F674AB6E7DF92B37D89E34DEFE047D8E89E0034FF85070D2AD4FF8E2B5E5DD5AD8E4BFDD8EB7A8F883C26D4F6C91DDE5ED775AC8B2DBCD57BAB1BAB599D5364D692BA23ABA6D5E84DE9BD51DD3A0F21D57F058D138AC5DC642E33396B482DA8B596692382F151772227C9436C8EDE25F01D2B0FC35E0FDCDBC52C5AA5D7A9A924970B67691BB2743FC95ED826DF12F46FF00A440B0BA1E7E1261A365B3CE6366BA9F6F6F777D7914F733326FD9BE499123544E75F022274A6F472C249C4CD0D24758E4D41A79E3AF9B6BE46C196BEE6F2A053827A16E9916CF5161A4DFE14ADBE1A567F7ED7638CB7C1B6C208E2E6BA527964AED5ADC479BB1EDF675F425B661D19F67A8858BAFA7B39A5E58DBE2BBCC4BC75AEE6F239ED596ADEB3F62E7A1C73232EE56A353EAAEE3E4AEBDE0B79063ADAA9A4F0D49E7C8585BC725967B28CD334D708896E916411117B6F06FDFD1BB79E0F8DE1DCB6F248974D4C45CF96D847163EE27BC8B33247717F0DB53647D8C30DD5BECED1FB6B64DFBD53DB421798FBD5CFF004FEC27BA8571AF02F4B6DE48B968DA9DCD1E672CCDF8EE761C7C3C1DBA82ACF65AB355DBB569C9639AFE2C85BD17D88AF617FDF2D0B420AC74D05AFA393745ADEAD1FA97381C6C9F8E1785C9CD6FC578F9AC579A46E569DCF359652091FEDA4372E8A05990569AE5B89F0455924C369DBD6A53F9BB5CA5D5B33FD8F2AB3D8BEFB9863E266A4820DF92D179C81AB4F32E3E7C6E597A3FA1B985D7EE01670157FF003E5854877DF63F51E296B4F3D6F30D7D1AA6CF5DE147FDF3B3E178CFA1F22AB4B5CEE36AD2799639A65B692ADEAF6575B1FF00001EF20E0ECF256D3AEE8668E6A569CE8D1B2C9D3EE1CCEEA01304375098000003C7B8A15DBA3B50B55EB1D6984CB568FE86F259B6783D4396CFEA88717263FCA51E905F5E792B5CEE558EDA475778BB5F61DD7B1DFEBB27AE759E295D41F911A824F34D1D70992E5CABD2EAF6AFB3AD3D7DCAE0555E205E4CFC20C2E1E1B49EB7394C7E97B65A32B2C56CCF2D9ECED657F0EF78F62278FAB7FD03E88474DB4DBF350F943F95D95BEB3D1386BCB9C7DAC51E474EA4"
    $pic &= "91D25C92E4DFB186178BCAECE7B685E549A58D552787B68526D89DA3F99CFACA804E846BDC4A86A00000000000000000000000000000000000000000000000000000000000000000000000000AB3F08C86B270F737B6B4E689672B5776DE986F2CE675DFEBEC56D9EDEC2D3158FE1170F6BC39CF2F2E7CADA27FD1D95D42FF00DD02C640EAC8AD4E7E7A73A7336D1D9411F6958E345ACAFBE4AD176EF6F59FD63716D5A5634AD3BAA8BC8E440F3BC9E85D3979CDAF3118BBAAFCF5B8B2B595BEFBA1E7D3F03F424AF495B4FE368F4AAB79A1D8BEFA23EC64F60B0A00AC9C63A5776948D295EBD6384F3529D355896E66EBFB1D9EFF0074E278D9B569A42BB1773EB6D3B173E4BE1ED9DDD7EFC6A72DC629E8975A3AB5AD3CFACF174F32F68DD76B7E9E0F7BC7F43C6713C70A55E6D17072A5647D6F839694FF00A385667940B5717857F4198C29DC660000006DEB4A7AA6E001B6D95FA8EAF99D3389C8C4B1E46CACEFD17AA8B736F15CAD1BD644991CEE200ADD7BC02E1FDCF367C0DA273AEEAD61ACB6ED4EADFD0F6D326DF70DAC9C0EC646AA98FCB6A7C4C695E744B2CCDE7674FF006575DB2166C0155E3E1FEBFB7929E4FAE2496DA3A728E1BDC3595CC955F565B849A177FB66E5ABC58B79AB4A7E4A64AD97BABCB25637527DBFE7A05FBE59F005665E216B0B6491F21A2EF6B1C74E7BB1B91B3C833FD8B7778666F711CF3FD47C53D27791C3F1A5D6A5D2B7695E50C935BE4B1B2233FAEE90BDACA9D3E09D1D0BA754E66BB280519C2C384B8B35C341AA71398C7DFC7E4F7769E571477103223ECB8C4A23BBC5F2AAAFE4CFBD11FAE174D9B1FA0EB7B1D4D8FD0D96B778952D2E6B1594CADB956DAE26BFB5B67B8C5C4FE2B1BC8A46992DBA3C8E669913A3A12E5653867A4EF5DE4B9C262AE24936EE91ECA0692BB3D4951379E3B91F834684B88DD21B3BAC7D64DD566B3BD9D79B746CF9299E687A1EBBD3626C47503C432BA534C2E6F4FE074BE396F3218ACFE3AEF2D7CB1C52B5A59DA4AFBD6F2F5FA3B57DBFCCA3F5F63B1D37EC43E9621E5BA5346E27058F8EC31D6D586DE3AA379957749222A23CEEFE396574E8767EB745DA9D08887AB010A7713214EE26000000000000000000000000000000D0D4000000000000000000000000000000000000000001E21AFB5F43A7EDED679AD6F2F1AEEF62B5892D21ED65AB3C534DE0774DCE891B3EC4EB7DDB113C6E9533881C6AB0CB62B546356B17C5B2E35698DCA2B3793DC5D3D82649ECA6DFFF0037B874664811F66F78264F1A6C2D7712F49C798C646AD909B16F61796F928AEA18D64EC64B3DEE8CE8FD0C89E3FB6A9E3F0155B88BAB38752683CF5D62D2D6F299999A36A5BC0D497E3492199E1BAB88A6D8F6FB120926DEE89BF6BBA6FDE05E2D1F91F2DC0E2AEEBDF738FB2B8AF9BFD6DBA3FF0078E6B2190B5B5B796E2EA78EDA1869BA49A695638E35F59DDFA14E89C31AD3F23F4FD39D39530D86A53AB77FDE50FD3FA4558E23710B079C9B0F888FB6AD29ABB171CD6B7903451642D62BD9ACE568B7F45DDBA5DED474EB7DEAFBD3A00BE50CD1C88AE8D4AA569CD6B4AF4D54E44ABDC229AB695CE606AD1F2C0E5E58AD22DCD568F1B7A897D62AEEEEEFD092C889EC45B3E81DFEDB889807CF4B82A6422AE5A04DCD6EDDAC6CFF0024936D4774D8CE9136F74477744EB7F03EC0E83C558249327A4288D5B793F2960FE574A6E68D52D6E6696DD3AD1FF94A2B43F4D36349BD3A10E3B8D095ADF689AD6B454A6B1C775FA1B6DCBA43EFEDD9EE9975D6771B7593D295B7B982E61B7D5CD6D3764CB22A5E458DBF4485EA9E17476F07B4751F841C997AC3A657118BBCC9DD41A8AC7211521859ED91AC566D915C4A9FCD23F6EBB1FC1B2299F7A6CEB0B40F9EC746F774ADDDAAD6C23596F2959957C9A3DAEE8D71FEA5362B3EF7FA0A761B5BC867892689D64864456475AEE5757F0323945F1DF0799B236D7971A8F2F77266729476C8C7693F6565274A258ACB6E889DB259BC7BD3C09BD7E9A275F79D35ACB5662F176D6B95D2394AC5616B6B6BE518EB8B3C835CC914288F2A592324CB13ED674D9BFC5B1F60172015F6DB8B38E9A78218F1BA85A696448DA95C2DFC4B0B3B78A579A14454FA7E373DFE9DC04C00000000000000000000000000069435214EE26000000000000000000000000000000000000000000000000000000000000000000000000079AEACD3ED95C7BDA2DF5FE3D99D6B49ACE458E4A6CFA2FBD1D1A27DDD68E9D68796627823A72DA5C54B25BB5D5DE1ED7C963BA97A649E1ECA68516E123D892EC46644E8E84D9D6FB0B3A00F9C97DF074CBC765778DC7677CA71F948F170DD2E496E249A1B7C75D3CD6CB68F0BEC5444DA888E9B1FAF63A6F4D9E9563C0AB7F22BFC54D792498DF8C56FF113528DF18E32E1DBB69BF94CC8E92C5BD55D1FE9EE9F7EF7D8E974410295F103863A965CFDCE4B4FE416CDB376B6B6393E7596378D61951D3256EF0F435C242BE4C88E9BD119DD1FADDD38CB1E0F66B6E6EDAEF27DB4926431D93C2E59A35F2B82F2DA0EC3B5BB8551119D12382199FAFB64677744777D979C163E3EE7F496ADD2ED698BB0C7DEE5254D456196B2BCEC567B6BABAF8BFB1B8597B1EBB774B9DCFB1DFAE0FA69D8EF7B058FD19C41C8667333DDE4EE71596B24C4A632E6DAAED879A3EC674BB5F2474D92A3D7ADD1D37C33323A3BA743DFDDB41B680515C4E36D743EA2BE92FA5CACF8ECCD859CB265A55BABE93E30B29A64962BB7851DD7B58AE6374774444DAE88FBD1DCB39A575C"
    $pic &= "6073693362AFE0BC582AB49B66E5ECD9F7EC57474E9F0FE13D3B6D0981B7D9D26E000000000000000000000000000000000D286A000000034035000000D00D41A1A8006800D41A003504799A57957BFCFF00A809821CA8395009831F2A1AF2A013063E54FD44762FAB4FD8066061E54FABD3DC4B6D3D14FD8064061D8BEAD3F613E540260C3B17D5A7EC25CA9F5019018F6D0D795009821CA842A8B5A79E94FD8066061A22FCD4A7EC3300043950972035043950972035043950972035063DB427C80D41A721C80D418EB4A57BCD795009821CA8395009821CA8395009821CA8395009834E44795009831F2A1AF2A013063DB435E540260872A1A72A7D406404395072A01A53F5FEB32000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFD9"
    Return $pic
EndFunc   ;==>_LOGOBin

Func _SetImageBinaryToCtrl($CtrlId, ByRef $Binary) ;Authors: Prog@ndy, Zedna

    Local $hData, $pData, $pStream, $pBitmap, $hBitmap
    Local Const $STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0, $SS_BITMAP = 0xE, $GWL_STYLE = -16

    Local $picdata = Binary($Binary)
    Local $piclength = BinaryLen($picdata)
    Local $picstruct = DllStructCreate("byte[" & $piclength & "]")
    DllStructSetData($picstruct,1,$picdata)
    Local $picmemory = DllStructGetPtr($picstruct)
    $hData = _MemGlobalAlloc($piclength,2)
    $pData = _MemGlobalLock($hData)
    _MemMoveMemory($picmemory,$pData,$piclength)
    _MemGlobalUnlock($hData)
    $pStream = DllCall( "ole32.dll","int","CreateStreamOnHGlobal", "int",$hData, "long",1, "Int*",0)
    $pStream = $pStream[3]
    _GDIPlus_Startup()
    $pBitmap = DllCall($ghGDIPDll,"int","GdipCreateBitmapFromStream", "ptr",$pStream, "int*",0)
    $pBitmap = $pBitmap[2]
    $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($pBitmap)
    Local $hWnd = GUICtrlGetHandle($CtrlId)
    If $hWnd = 0 Then Return SetError(1, 0, 0)
    Local $oldStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE)
    If @error Then Return SetError(2, 0, 0)
    DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "long", BitOR($oldStyle[0], $SS_BITMAP))
    If @error Then Return SetError(3, 0, 0)
        Local $oldBmp = DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hWnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
    If @error Then Return SetError(4, 0, 0)
    If $oldBmp[0] <> 0 Then _WinAPI_DeleteObject($oldBmp[0])
    _GDIPlus_BitmapDispose($pBitmap)
    _GDIPlus_Shutdown()
    _WinAPI_DeleteObject($pStream)
    _MemGlobalFree($hData)
    DllStructSetData($picstruct,1,0)
    $picstruct = ""

EndFunc

Try using this function

Func STATIC_SETBITMAP($hWnd,$HandleImage)
Local $GWL_STYLE = (-16) , $SS_BITMAP = 0x0000000E , $SS_ICON   = 0x00000003 ,$STM_SETIMAGE = 0x0172
If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
if Not BitAND(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), $SS_BITMAP) = $SS_BITMAP Then
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) + $SS_BITMAP )
ElseIf  BitAND(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), $SS_ICON) = $SS_ICON Then
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) - $SS_ICON)
EndIf
Return _SendMessage($hWnd, $STM_SETIMAGE, 0, $HandleImage)
EndFunc

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks to everyone for help me

Edited by mesale0077

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0