--- a/WinWorkstation.st Sun Oct 09 22:55:22 2016 +0100
+++ b/WinWorkstation.st Tue Oct 11 07:03:43 2016 +0200
@@ -18635,7 +18635,7 @@
"
!
-sendCopyData: aByteArray toWindowId: aWindowId
+sendCopyData: aByteArrayOrString toWindowId: aWindowId
"send copy-paste data to a window by id (handle)"
|externalBytes messageType lParam copyDataStruct|
@@ -18644,7 +18644,7 @@
messageType := 74 "WM_COPYDATA".
- externalBytes := aByteArray asExternalBytesUnprotected.
+ externalBytes := aByteArrayOrString asExternalBytesUnprotected.
copyDataStruct := CopyDataStructStructure new.
copyDataStruct
cbData:externalBytes size;
@@ -18653,33 +18653,21 @@
^ self primSendMessage:aWindowId message:messageType wParam:nil lParam:lParam.
"
- |bytes externalAddress handle|
+ |handle|
+ handle := Display primFindWindowA: nil windowName: 'expecco'.
+ (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
+ Display sendCopyData: 'openPath: bla' toWindowId: handle.
+ Display setForegroundWindow: handle.
+ "
+
+ "
+ |bytes handle|
bytes := 'c:\pipo.net' asByteArray.
handle := Display primFindWindowA: nil windowName: 'ST/X Launcher'.
(handle isNil or:[handle address == 0]) ifTrue:[self halt.].
- externalAddress := handle asExternalAddress.
- Display setForegroundWindow: externalAddress.
- Display sendCopyData: bytes toWindowId: externalAddress.
- "
-!
-
-sendCopyDataString: aString toWindowId: aWindowId
- "send a string as copy-paste data to a window by id (handle)"
-
- |aByteArray nullTerminatedString |
-
- nullTerminatedString := aString , 0 asCharacter asString.
- aByteArray := nullTerminatedString asByteArray.
- self sendCopyData: aByteArray toWindowId: aWindowId
-
- "
- |externalAddress handle|
- handle := Display primFindWindowA: nil windowName: 'Windows-Befehlsprozessor'.
- (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
- externalAddress := handle asExternalAddress.
- Display setForegroundWindow: externalAddress.
- Display sendCopyDataString: 'c:\windows\notepad.exe' toWindowId: externalAddress.
+ Display setForegroundWindow: handle.
+ Display sendCopyData: bytes toWindowId: handle.
"
!
@@ -18760,18 +18748,7 @@
a different process is currently active - in this case the title bar/icon is flashed.
this also raises the priority of the sending thread slightly"
-%{ /* NOCONTEXT */
- if (__isExternalAddress(aWindowId)) {
- HWND win = _HWNDVal(aWindowId);
-
- if (win) {
- CPRINTF(("setForegroundWindow %x\n",win));
-
- SetForegroundWindow(win);
- }
- RETURN ( self );
- }
-%}
+ <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" >
!
setIconName:aString in:aWindowId
@@ -19431,16 +19408,17 @@
cbData
ExternalAddress pointerSize == 8 ifTrue:[
- ^ self unsignedInt64At: 8 + 1.
+ ^ self unsignedInt32At: 8 + 1.
].
^ self unsignedInt32At: 4 + 1.
!
cbData: cbData
ExternalAddress pointerSize == 8 ifTrue:[
- ^ self unsignedInt64At: 8 + 1 put: cbData.
- ].
- ^ self unsignedInt32At: 4 + 1 put: cbData.
+ self unsignedInt32At: 8 + 1 put: cbData.
+ ] ifFalse:[
+ self unsignedInt32At: 4 + 1 put: cbData.
+ ].
!
dwData
@@ -19452,9 +19430,10 @@
dwData: dwData
ExternalAddress pointerSize == 8 ifTrue:[
- ^ self unsignedInt64At: 0 + 1 put:dwData.
- ].
- ^ self unsignedInt32At: 0 + 1 put:dwData.
+ self unsignedInt64At: 0 + 1 put:dwData.
+ ] ifFalse:[
+ self unsignedInt32At: 0 + 1 put:dwData.
+ ].
!
lpData
@@ -19466,9 +19445,10 @@
lpData: lpData
ExternalAddress pointerSize == 8 ifTrue:[
- ^ self unsignedInt64At: 12 + 1 put: lpData.
- ].
- ^ self unsignedInt32At: 8 + 1 put: lpData.
+ self unsignedInt64At: 12 + 1 put: lpData.
+ ] ifFalse:[
+ self unsignedInt32At: 8 + 1 put: lpData.
+ ].
! !
!WinWorkstation::MonitorInfo methodsFor:'accessing'!