Basic: &H1, BlitzMax: ???

Übersicht BlitzMax, BlitzMax NG Beginners-Corner

Neue Antwort erstellen

FOODy

Betreff: Basic: &H1, BlitzMax: ???

BeitragMi, Jul 12, 2006 21:20
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi Leute.
Ich hoffe mal das es hier reinpasst.
Ich würde gerne diesen Code in BlitzMax umschreiben: (Basic)
Code: [AUSKLAPPEN]
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2


Aber ich hab keine ahnung was das &H1 darstellen soll o.O
Ist das eine TeilReferenz?

Bitte Klärt mich auf Very Happy


Gruß,
FOODy

Suco-X

BeitragMi, Jul 12, 2006 21:26
Antworten mit Zitat
Benutzer-Profile anzeigen
Code: [AUSKLAPPEN]

Const KEYEVENTF_EXTENDEDKEY = $1
Const KEYEVENTF_KEYUP = $2


&H einfach zu $
Mfg Suco
Intel Core 2 Quad Q8300, 4× 2500 MHz, 4096 MB DDR2-Ram, GeForce 9600GT 512 MB

FOODy

BeitragMi, Jul 12, 2006 21:31
Antworten mit Zitat
Benutzer-Profile anzeigen
Ah danke Very Happy

Spiel grad etwas mit der API rum. (mit der begleitung von API-Guide *g*)
Danke nochmal, Suco-X!!!
Das kommt nähmlich verdammt häufig vor!

Hier mal ein Code. (Tasteneinschläge Simulieren) (Von Basic auf BlitzMax umgeschrieben also nichts großes von mir ;D)
Code: [AUSKLAPPEN]

Framework BRL.StandardIO
Import BRL.Retro

Import "-luser32"

Extern "Win32"
   Function keybd_event(bVk:Byte,bScan:Byte,dwFlags,dwExtraInfo)
EndExtern

Const KEYEVENTF_EXTENDEDKEY = $1
Const KEYEVENTF_KEYUP = $2

Function AddKey(key)
   keybd_event key, 0, 0, 0
   keybd_event key, 0, KEYEVENTF_KEYUP, 0
EndFunction

Global VK_H = Asc("H")
Global VK_E = Asc("E")
Global VK_L = Asc("L")
Global VK_O = Asc("O")


Delay(1000)
AddKey(VK_H)
AddKey(VK_E)
AddKey(VK_L)
AddKey(VK_L)
AddKey(VK_O)

FOODy

BeitragMi, Jul 12, 2006 23:30
Antworten mit Zitat
Benutzer-Profile anzeigen
Wie kann ich eigentlich Typen in BlitzMax umsetzen?
Hab bis jetzt ohne erfolg rumprobiert Sad

VB:
Code: [AUSKLAPPEN]
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Private Type SYSTEM_INFO
    dwOemID As Long
    dwPageSize As Long
    lpMinimumApplicationAddress As Long
    lpMaximumApplicationAddress As Long
    dwActiveProcessorMask As Long
    dwNumberOrfProcessors As Long
    dwProcessorType As Long
    dwAllocationGranularity As Long
    dwReserved As Long
End Type
Private Sub Form_Load()
    Dim SInfo As SYSTEM_INFO
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'KPDTeam@Allapi.net
    'Set the graphical mode to persistent
    Me.AutoRedraw = True
    'Get the system information
    GetSystemInfo SInfo
    'Print it to the form
    Me.Print "Number of procesor:" + str$(SInfo.dwNumberOrfProcessors)
    Me.Print "Processor:" + str$(SInfo.dwProcessorType)
    Me.Print "Low memory address:" + str$(SInfo.lpMinimumApplicationAddress)
    Me.Print "High memory address:" + str$(SInfo.lpMaximumApplicationAddress)
End Sub




PS:
Möcht deswegen jetzt keinen neuen Thread erstellen, also bitte nicht böse sein Sad

Suco-X

BeitragMi, Jul 12, 2006 23:53
Antworten mit Zitat
Benutzer-Profile anzeigen
Eigentlich kannst du das fast 1:1 übernehmen. Du musst dir nur ein paar Sachen merken:
Ich habe ja ka was Long in VB darstellt, aber bei BMX solltest du stattdessen immer Int benutzen. Und wenn du Pointer hast, immer Byte Ptr benutzen.

Obiger Code würde in BMX also so aussehen:

Code: [AUSKLAPPEN]

Strict

Extern "Win32"
   Function GetSystemInfo(Temp:Byte Ptr)
End Extern

Type SYSTEM_INFO
   Field dwOemID:Int
   Field dwPageSize:Int
   Field lpMinimumApplicationAddress:Int
   Field lpMaximumApplicationAddress:Int
   Field dwActiveProcessorMask:Int
   Field dwNumberOfProcessors:Int
   Field dwProcessorType:Int
   Field dwAllocationGranularity:Int
   Field dwReserved:Int
End Type


Local Test:SYSTEM_INFO = New SYSTEM_INFO
GetSystemInfo(Test)

Print "NUmber of processor: " + Test.dwNumberOfProcessors
Print "Processor: "+Test.dwProcessorType
Print "Low memory address: " + Test.lpMinimumApplicationAddress
Print "High memory address: "+Test.lpMaximumApplicationAddress

Mfg Suco
Intel Core 2 Quad Q8300, 4× 2500 MHz, 4096 MB DDR2-Ram, GeForce 9600GT 512 MB

FOODy

BeitragMi, Jul 12, 2006 23:57
Antworten mit Zitat
Benutzer-Profile anzeigen
WOW!!!
Das funzt sogar. Very Happy
DANKE!!!!!!!! Very HappyVery HappyVery Happy

Du bist mein Held, Suco-X. Very Happy


Gruß,
FOODy

Neue Antwort erstellen


Übersicht BlitzMax, BlitzMax NG Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group