BBC BASIC for Windows
« Commented Libraries »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:28pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Commented Libraries  (Read 936 times)
Malcolm
Guest
xx Re: Commented Libraries
« Reply #2 on: Mar 23rd, 2011, 4:41pm »

Anyone like to expand as to what this does and why?

[OPT 2
.K% push H% : call "SetFocus" : ret 16
.M% cmp dword [esp+8],&500 : jz K%
pop eax : push [^O%] : push eax : jmp "CallWindowProc"
]

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Commented Libraries
« Reply #3 on: Mar 23rd, 2011, 6:58pm »

on Mar 23rd, 2011, 4:41pm, Guest-Malcolm wrote:
Anyone like to expand as to what this does and why?

It calls the SetFocus API, but in the context of the thread containing the message pump rather than the interpreter's thread.

The documentation of SetFocus says: "The SetFocus function sets the keyboard focus to the specified window. The window must be attached to the calling thread's message queue":

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

Since the interpreter's thread doesn't have a message queue, simply doing SYS "SetFocus" doesn't work.

Richard.
User IP Logged

Malcolm
Guest
xx Re: Commented Libraries
« Reply #4 on: Mar 23rd, 2011, 11:02pm »

Thanks Richard,

I understand the concept of threads but not the practicality. I had better read up some more.

Malcolm.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls