Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:06:22+00:00 2026-06-01T14:06:22+00:00

I want to make a windowless application. The problem is that I’m using a

  • 0

I want to make a windowless application. The problem is that I’m using a framework that shows some alert boxes sometimes, and I’m not able to suppress them (at least not without a crash).

I’ve set LSBackgroundOnly to 1 (in the info.plist app file), but this doesn’t seem to work. Any chance I’m missing something here (maybe some other settings that I need to set)?

I’ve also tried creating a category for NSWindow:

  1. Overwritten alloc and allocWithZone: so that no window gets created. This works on some situations, but starting a modal session throws exception (because sending a nil parameter to beginModalSessionForWindow:).

  2. Tried overwriting NSApplication’s beginModalSessionForWindow: and returned nil everytime, but this leads to EXC_BADACCESS somewhere in the framework (runModalSession: and endModalSession: were also overwritten, but the crash is before any of them being called).

Any other ideas will be welcome.

In case it helps, the framework that I’m using is Twain.Framework, so if instead anyone knows a way to block all UI from twain (this includes error alerts shown when a device is not connected) it would be great if you share.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:06:23+00:00Added an answer on June 1, 2026 at 2:06 pm

    I managed to make it ‘windowless’ (some windows are still shown, but at least they’re not visible, and they’re automatically closed). I only handled modal windows, since these where shown in my situation.

    1. I made a category for NSWindow, so that all windows are invisible, and can’t become key or main windows:

      -(BOOL)canBecomeKeyWindow{
         [self setOpaque:NO];
         self.alphaValue = 0;
         return NO;
      }
      -(BOOL)canBecomeMainWindow{
         [self setOpaque:NO];
         self.alphaValue = 0;
         return NO;
      }
      
    2. Subclassed NSApplication:

      -(NSInteger)runModalForWindow:(NSWindow *)aWindow{
         return NSCancelButton;
      }
      -(NSModalSession)beginModalSessionForWindow:(NSWindow *)aWindow{
         NSModalSession session = [super beginModalSessionForWindow:aWindow];
         [aWindow performSelector:@selector(close) withObject:nil afterDelay:1];
         return session;
      }
      

    However, this didn’t help much. In case of runModalForWindow: everything was good, since the owner of the window received a response. In case of beginModalSessionForWindow: the application got stuck, most probably because the window’s owner was waiting for a specific event (e.g. button click) which it never received.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want make validation jquery without using from plugin , problem is here that
I want make some progress bar in my application with three20 library when sending
I want make a xslt transformation to xsl-fo but I´m not really sure that
I want make a alert that after click on button delete ask did you
I want make datetimepicker in my project. Using jquery how it is possible? I
I want make interactive application where user launches it and can do various task
Let's say I want make some of my sources publicly available via my blog
I am traversing a HTML document using javascript DOM. I want make a list
I want make the control height as double when the mouse is over that
I want to make a class serializable but i dont want make serializable some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.