Windows - Arrrghhh - i've resorted to pulling my hair out - HELP! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Windows - Arrrghhh - i've resorted to pulling my hair out - HELP!

The Setting
----------------------
Let me set the scene. I'm developing an application which should work anywhere where the flashing cursor thingy (caret) can be displayed.


The Problem
----------------------
I've tackled the problem ALMOST, but because my form (called frmMain) is active and on top of the other windows, i don't know how to set focus to ANY other open window/document.


Bascially what i'm trying to do is, when a button is clicked, the form (or my application) looses focus and focus is gained to an already open application and to an object that the user chooses in that application where the flashing cursor thingy (caret) can be displayed.

In another words this is what i need to achieve (remember this is just an example - the actual code needs to work with ANY application):
- 3 Applications are running
- User is currently using Internet Explorer and typing words into a search engine
- User decides he needs to use my application
- User loads up my application
- User clicks button called cmd1
Point A - My application looses focus
Point B - User selects the internet explorer window somehow and the text area where he was typing, somehow.
Point C - Upon selecting the text area where the caret can be displayed all text is highlighted.
- My application remains on top but not active (done this bit!)


Main Points
------------------
Points A, B and C above, are the main problems i need help with.

I have seen a possible way of doing point A - Like in Jasc Paint Shop Pro's screen capture where jasc draws red boxes around objects and windows until the user clicks, then the object is captured
Same sort of functions i want to achieve only when the User clicks text should be highlighed - but don't know how the hell Jasc did it.

Please if you have an idea of how to achieve this, post it with some code to guide me.

I THANK YOU in advance!!!

Jazz...
The Coding Freak

P.S. Using Visual Basic 6

Comments

  • ZantosZantos Posts: 139Member
    I can kinda help you here...but only with the whole text selecting thing...like if you have a textbox called txtText
    [code]
    With txtText
    .SelStart = 1
    .SelLength = Len(txtText)
    End With
    [/code]

    and if you put that code into the txtText_Click() sub, it'll select all
    the text in it. Once you figure out how to set focus to another program
    it just might help. The funny thing is I've always wondered how to do
    that as well...set focus to another window that is. Good question dude!

    : The Setting
    : ----------------------
    : Let me set the scene. I'm developing an application which should work anywhere where the flashing cursor thingy (caret) can be displayed.
    :
    :
    : The Problem
    : ----------------------
    : I've tackled the problem ALMOST, but because my form (called frmMain) is active and on top of the other windows, i don't know how to set focus to ANY other open window/document.
    :
    :
    : Bascially what i'm trying to do is, when a button is clicked, the form (or my application) looses focus and focus is gained to an already open application and to an object that the user chooses in that application where the flashing cursor thingy (caret) can be displayed.
    :
    : In another words this is what i need to achieve (remember this is just an example - the actual code needs to work with ANY application):
    : - 3 Applications are running
    : - User is currently using Internet Explorer and typing words into a search engine
    : - User decides he needs to use my application
    : - User loads up my application
    : - User clicks button called cmd1
    : Point A - My application looses focus
    : Point B - User selects the internet explorer window somehow and the text area where he was typing, somehow.
    : Point C - Upon selecting the text area where the caret can be displayed all text is highlighted.
    : - My application remains on top but not active (done this bit!)
    :
    :
    : Main Points
    : ------------------
    : Points A, B and C above, are the main problems i need help with.
    :
    : I have seen a possible way of doing point A - Like in Jasc Paint Shop Pro's screen capture where jasc draws red boxes around objects and windows until the user clicks, then the object is captured
    : Same sort of functions i want to achieve only when the User clicks text should be highlighed - but don't know how the hell Jasc did it.
    :
    : Please if you have an idea of how to achieve this, post it with some code to guide me.
    :
    : I THANK YOU in advance!!!
    :
    : Jazz...
    : The Coding Freak
    :
    : P.S. Using Visual Basic 6
    :
    :

    [code]
    [b]..:[/b] Zantos [b]:..[/b]
    [blue]Mega[/blue][red]Riot[/red] Productions
    http://www.megariot.funurl.com
    [/code]

Sign In or Register to comment.