Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 2 of 2
  1. #1
    konan is offline Registered User
    Join Date
    May 2002
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I manipulate a "View" oir window in Cocoa?

    Here is what I want to do... I want to grab a window that was created in my program (Cocoa) and manipulate it. The only hitch is that I want to grab the window by it's text caption, and without any knowledge of how the window was originally created.

    In Windows, I would do something like this

    // Get the handle to the window...
    HWND Handle = FindWindow("Window's Title");
    if (Handle)
    {
    Manipluate window
    }
    else
    Message("Cannot find the window");

    How could I do this in Cocoa?

    Konan

  2. #2
    Oscar Castillo's Avatar
    Oscar Castillo is offline Registered User
    Join Date
    Oct 2000
    Location
    New Jersey
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nameOfWindow = [NSWindow title] will return the window title in the form of an NSString
    MacBook Pro 15" 2GHz Quad i7-8GB RAM-240GB OCZ SSD-750GB HD-OS X Lion
    PowerMac G4 1.42GHz Dual PPC-2GB RAM-240GB OCZ SSD-OS X Leopard-MorphOS 2.7
    PowerMac G4 Cube 450MHz PPC-1GB RAM-100HD-OS X Leopard
    iPad 64GB Wifi/3G-iOS 5
    iPhone 4S 64GB-iOS 5

 

 

Similar Threads

  1. [HOWTO] - Clone a finder window.
    By MacLuv in forum HOWTO & FAQs
    Replies: 2
    Last Post: May 21st, 2004, 10:12 PM
  2. Open new window -> re-use open window?
    By MDLarson in forum Design & Media
    Replies: 9
    Last Post: September 12th, 2003, 05:53 PM
  3. OS-X enhancement: window focus, no raise
    By gweber in forum Opinions, & Open Letters
    Replies: 1
    Last Post: November 4th, 2002, 07:58 AM
  4. using window title-bar to navigate through open windows
    By Remco in forum Opinions, & Open Letters
    Replies: 8
    Last Post: May 24th, 2002, 02:15 PM
  5. Cocoa Newbie needs help with Document Window
    By geekgrl in forum Software Programming & Web Scripting
    Replies: 6
    Last Post: May 16th, 2002, 12:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •